/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scripting.map;

import client.*;
import client.inventory.Equip;
import client.inventory.Item;
import client.inventory.MapleInventory;
import client.inventory.MapleInventoryType;
import client.skills.SkillEntry;
import client.skills.SkillFactory;
import constants.GameConstants;
import constants.ServerConstants;
import constants.skills.双弩;
import constants.skills.恶魔猎手;
import constants.skills.战神;
import lombok.extern.log4j.Log4j2;
import scripting.AbstractPlayerInteraction;
import scripting.event.EventInstanceManager;
import scripting.event.EventManager;
import scripting.npc.NPCScriptManager;
import server.MapleInventoryManipulator;
import server.MapleItemInformationProvider;
import server.Timer;
import server.life.MapleLifeFactory;
import server.life.MapleMonster;
import server.life.OverrideMonsterStats;
import server.maps.MapleMap;
import server.maps.MapleMapFactory;
import server.maps.MapleNodes;
import server.maps.SavedLocationType;
import server.maps.events.Event_PyramidSubway;
import server.quest.MapleQuest;
import server.quest.MedalQuest;
import tools.MaplePacketCreator;
import tools.Randomizer;
import tools.packet.EffectPacket;
import tools.packet.MobPacket;
import tools.packet.NPCPacket;
import tools.packet.UIPacket;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;

/**
 * @author PlayDK
 */
@Log4j2
public class MapScriptMethods extends AbstractPlayerInteraction {

    private static final Point witchTowerPos = new Point(-60, 184);
    private static final String[] mulungEffects = {
            "胆子真够大的！别把鲁莽和勇敢混为一谈！",
            "想挑战武陵道场…还真有勇气！",
            "我等你！还有勇气的话，欢迎再来挑战！",
            "挑战武陵道场的家伙，我一定会让他(她)后悔！！",
            "想被称呼为失败者吗？欢迎来挑战！"};

    public MapScriptMethods(MapleClient c) {
        super(c);
    }

    public static void startDirectionInfo(MapleCharacter chr, boolean start) {
        final MapleClient c = chr.getClient();
        boolean bl3 = false;
        MapleNodes.DirectionInfo di = chr.getMap().getDirectionInfo(start ? 0 : chr.getDirection());
        if (di != null && di.eventQ.size() > 0) {
            if (start) {
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.getDirectionInfo(3, 4));
            } else {
                for (String s : di.eventQ) {
                    switch (s) {
                        case "merTutorDrecotion01": //direction info: 1 is probably the time
                            c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/0", 2000, 0, -100, 1));
                            break;
                        case "merTutorDrecotion02":
                            c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/1", 2000, 0, -100, 1));
                            break;
                        case "merTutorDrecotion03":
                            c.announce(UIPacket.getDirectionInfo(3, 2));
                            c.announce(UIPacket.getDirectionStatus(true));
                            c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/2", 2000, 0, -100, 1));
                            break;
                        case "merTutorDrecotion04":
                            c.announce(UIPacket.getDirectionInfo(3, 2));
                            c.announce(UIPacket.getDirectionStatus(true));
                            c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/3", 2000, 0, -100, 1));
                            break;
                        case "merTutorDrecotion05":
                            c.announce(UIPacket.getDirectionInfo(3, 2));
                            c.announce(UIPacket.getDirectionStatus(true));
                            c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/4", 2000, 0, -100, 1));
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(3, 2));
                                c.announce(UIPacket.getDirectionStatus(true));
                                c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/5", 2000, 0, -100, 1));
                            }, 2000);
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.IntroEnableUI(0));
                                c.announce(MaplePacketCreator.updatePlayerStats(chr));
                            }, 4000);
                            break;
                        case "merTutorDrecotion12":
                            c.announce(UIPacket.getDirectionInfo(3, 2));
                            c.announce(UIPacket.getDirectionStatus(true));
                            c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/8", 2000, 0, -100, 1));
                            c.announce(UIPacket.IntroEnableUI(0));
                            break;
                        case "merTutorDrecotion21":
                            c.announce(UIPacket.getDirectionInfo(3, 1));
                            c.announce(UIPacket.getDirectionStatus(true));
                            MapleMap mapto = c.getChannelServer().getMapFactory().getMap(910150005);
                            c.getPlayer().changeMap(mapto, mapto.getPortal(0));
                            break;
                        case "ds_tuto_0_2":
                            c.announce(MaplePacketCreator.showEffect("demonSlayer/text1"));
                            break;
                        case "ds_tuto_0_1":
                            c.announce(UIPacket.getDirectionInfo(3, 2));
                            break;
                        case "ds_tuto_0_3":
                            c.announce(MaplePacketCreator.showEffect("demonSlayer/text2"));
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(1, 4000));
                                c.announce(MaplePacketCreator.showEffect("demonSlayer/text3"));
                            }, 2000);
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(1, 500));
                                c.announce(MaplePacketCreator.showEffect("demonSlayer/text4"));
                            }, 6000);
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(1, 4000));
                                c.announce(MaplePacketCreator.showEffect("demonSlayer/text5"));
                            }, 6500);
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(1, 500));
                                c.announce(MaplePacketCreator.showEffect("demonSlayer/text6"));
                            }, 10500);
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(1, 4000));
                                c.announce(MaplePacketCreator.showEffect("demonSlayer/text7"));
                            }, 11000);
                            Timer.EventTimer.getInstance().schedule(() -> {
                                c.announce(UIPacket.getDirectionInfo(4, 2159307));
                                NPCScriptManager.getInstance().dispose(c);
                                NPCScriptManager.getInstance().start(c, 2159307);
                            }, 15000);
                            break;
                    }
                    if (bl3) {
                        c.getPlayer().updateMapScript(MapScriptType.directionInfo, s);
                    } else {
                        c.getPlayer().updateMapScript(MapScriptType.UNK, s);
                    }
                }
            }
            c.announce(UIPacket.getDirectionInfo(1, 2000));
            chr.setDirection(chr.getDirection() + 1);
            if (chr.getMap().getDirectionInfo(chr.getDirection()) == null) {
                chr.setDirection(-1);
            }
        } else if (start) {
            switch (chr.getMapId()) {
                //hack
                case 931050300:
                    while (chr.getLevel() < 10) {
                        chr.levelUp();
                    }
                    MapleMap mapto = c.getChannelServer().getMapFactory().getMap(931050000);
                    chr.changeMap(mapto, mapto.getPortal(0));
                    break;
            }
        }
    }

    public static void startScript_FirstUser(MapleClient c, String scriptName) {
        if (c.getPlayer() == null) {
            return;
        } //o_O
        boolean bl2 = false;
        switch (scriptName) {
            case "pierre_Summon":
            case "pierre_Summon1": {
                final MapleMap map = c.getPlayer().getMap();
                final EventInstanceManager eventInstance = c.getPlayer().getEventInstance();
                if (eventInstance != null && eventInstance.getProperty("show").equals("0")) {
                    eventInstance.setProperty("show", "1");
                    map.startMapEffect("欢迎你来参加皮埃尔的茶会！", 5120098);
                }
                break;
            }
            case "VanLeon_Before": {
                final MapleMap map2 = c.getPlayer().getMap();
                if (!map2.containsNPC(2161000) && map2.getMobsSize() <= 0) {
                    map2.resetFully();
                    map2.spawnNpc(2161000, new Point(-5, -181));
                    break;
                }
                break;
            }
            case "cygnus_AK_mapEnterEff": {
                final MapleMap map3 = c.getPlayer().getMap();
                if (!map3.containsNPC(9390417) && map3.getMobsSize() <= 0) {
                    map3.spawnNpc(9390417, new Point(0, -181));
                    break;
                }
                break;
            }
            case "Ranmaru_Before2": {
                handleRanmaru_Before(c);
                break;
            }
            case "mCastle_enter": {
                c.announce(MaplePacketCreator.showEffect("event/mCastle"));
                break;
            }
            case "mapFU_910028310": {
                c.getPlayer().getMap().resetFully();
                c.getPlayer().getMap().startMapEffect("请确认消灭所有怪物!", 5120079);
                break;
            }
            case "mapFU_910028360": {
                c.getPlayer().getMap().resetFully();
                c.getPlayer().getMap().startMapEffect("Get rid of the Whipped Cream Wight.", 5120079);
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9500579), new Point(733, 146));
                break;
            }
            case "mapFU_910028330": {
                c.getPlayer().getMap().resetFully();
                c.getPlayer().getMap().startMapEffect("Hunt down Witch Cats and collect 10 Party Outfix Boxes.", 5120079);
                break;
            }
            case "mapFU_910028350": {
                c.getPlayer().getMap().resetFully();
                c.getPlayer().getMap().startMapEffect("Vanquish those ghosts and find the letter.", 5120079);
                break;
            }
            case "boss_Event_PinkZakum": {
                c.getPlayer().getMap().startMapEffect("DO NOT BE ALARMED! The Pink Zakum clone was just to help adventurers like you relieve stress!", 5120039);
                break;
            }
            case "dojang_Eff": {
                int temp = (c.getPlayer().getMapId() - 925000000) / 100;
                int stage = temp - ((temp / 100) * 100);
                sendDojoClock(c, getTiming(stage) * 60);
                sendDojoStart(c, stage - getDojoStageDec(stage));
                break;
            }
            case "PinkBeen_before": {
                handlePinkBeanStart(c);
                break;
            }
            case "onRewordMap": {
                reloadWitchTower(c);
                break;
            }
            //5120019 = orbis(start_itemTake - onUser)
            case "WUmoonrabbit_mapEnter":
            case "moonrabbit_mapEnter": {
                c.getPlayer().getMap().startMapEffect("收集迎月花种子并种下,并保护好月妙!!", 5120016);
                break;
            }
            case "Ranmaru_Before": {
                handleRanmaru_Before(c);
                break;
            }
            case "queen_summon0": {
                if (c.getPlayer().getMap().getMobsSize() != 0) break;
                break;
            }
            case "abysscave_ent": {
                break;
            }
            case "banban_Summon": {
                if (c.getPlayer().getMap().getMobsSize() != 0) break;
                break;
            }
            case "WUStageMsg_goddess": {
                switch (c.getPlayer().getMapId()) {
                    case 933031000: {
                        c.getPlayer().getMap().startMapEffect("请带回来所有的女神像碎片!!", 5120019);
                        break;
                    }
                    case 933032000: {
                        c.getPlayer().getMap().startMapEffect("请找到今天所属的LP唱片.把LP放在中央的留声机前面,可以演奏音乐!", 5120019);
                        break;
                    }
                    case 933033000: {
                        c.getPlayer().getMap().startMapEffect("请消灭<仓库>里的独角狮.", 5120019);
                        break;
                    }
                    case 933034000: {
                        c.getPlayer().getMap().startMapEffect("请消灭怪物,收集30个小碎片!", 5120019);
                        break;
                    }
                    case 933035000: {
                        c.getPlayer().getMap().startMapEffect("找到正确的踏板,爬到顶上去操纵开关!", 5120019);
                        break;
                    }
                    case 933036000: {
                        break;
                    }
                    case 933037000: {
                        c.getPlayer().getMap().startMapEffect("请把食人花的种子种到花盆里,寻找黑食人花生长的花盆!", 5120019);
                        break;
                    }
                }
                break;
            }
            case "StageMsg_goddess": {
                switch (c.getPlayer().getMapId()) {
                    case 920010000: {
                        c.getPlayer().getMap().startMapEffect("请收集云片来救我!!", 5120019);
                        break;
                    }
                    case 920010100: {
                        c.getPlayer().getMap().startMapEffect("请带回来所有的女神像碎片!!", 5120019);
                        break;
                    }
                    case 920010200: {
                        c.getPlayer().getMap().startMapEffect("消灭所有怪物并收集碎片!", 5120019);
                        break;
                    }
                    case 920010300: {
                        c.getPlayer().getMap().startMapEffect("消灭每一层出现的怪物并收集碎片!!", 5120019);
                        break;
                    }
                    case 920010400: {
                        c.getPlayer().getMap().startMapEffect("获得女神的LP.把LP放在中央的留声机前面,可以演奏音乐!", 5120019);
                        break;
                    }
                    case 920010500: {
                        c.getPlayer().getMap().startMapEffect("找出正确的组合!", 5120019);
                        break;
                    }
                    case 920010600: {
                        c.getPlayer().getMap().startMapEffect("消灭所有怪物并收集碎片!", 5120019);
                        break;
                    }
                    case 920010700: {
                        c.getPlayer().getMap().startMapEffect("到达顶部,并找出正确的组合!!", 5120019);
                        break;
                    }
                    case 920010800: {
                        c.getPlayer().getMap().startMapEffect("召唤并消灭精灵爸爸!!", 5120019);
                    }
                }
                break;
            }
            case "StageMsg_crack": {
                switch (c.getPlayer().getMapId()) {
                    case 922010100: {
                        c.getPlayer().getMap().startMapEffect("消灭次元玩具白鼠和次元玩具黑鼠，搜集20张次元通行证！", 5120018);
                        break;
                    }
                    case 922010200: {
                        c.getPlayer().getMap().startMapEffect("打开箱子,搜集所有的通行证！", 5120018);
                        break;
                    }
                    case 922010300: {
                        c.getPlayer().getMap().startMapEffect("Destroy the monsters!", 5120018);
                        break;
                    }
                    case 922010400: {
                        c.getPlayer().getMap().startMapEffect("请消灭次元洞里的黑眼鬼和黑眼怪,并搜集所有的通行证！", 5120018);
                        break;
                    }
                    case 922010500: {
                        c.getPlayer().getMap().startMapEffect("Collect passes from each room!", 5120018);
                        break;
                    }
                    case 922010600: {
                        c.getPlayer().getMap().startMapEffect("解开隐藏的箱子的密码，爬到顶部。", 5120018);
                        break;
                    }
                    case 922010700: {
                        c.getPlayer().getMap().startMapEffect("消灭这里所有的战甲吹泡泡鱼！", 5120018);
                        break;
                    }
                    case 922010800: {
                        c.getPlayer().getMap().startMapEffect("听问题，爬到正确答案对应的箱子上去！", 5120018);
                        break;
                    }
                    case 922010900: {
                        c.getPlayer().getMap().startMapEffect("消灭阿丽莎乐！", 5120018);
                    }
                }
                break;
            }
            case "StageMsg_together": {
                switch (c.getPlayer().getMapId()) {
                    case 103000800:
                        c.getPlayer().getMap().startMapEffect("Solve the question and gather the amount of passes!", 5120017);
                        break;
                    case 103000801:
                        c.getPlayer().getMap().startMapEffect("Get on the ropes and unveil the correct combination!", 5120017);
                        break;
                    case 103000802:
                        c.getPlayer().getMap().startMapEffect("Get on the platforms and unveil the correct combination!", 5120017);
                        break;
                    case 103000803:
                        c.getPlayer().getMap().startMapEffect("Get on the barrels and unveil the correct combination!", 5120017);
                        break;
                    case 103000804:
                        c.getPlayer().getMap().startMapEffect("Defeat King Slime and his minions!", 5120017);
                        break;
                }
                break;
            }
            case "StageMsg_romio": {
                switch (c.getPlayer().getMapId()) {
                    case 926100000:
                        c.getPlayer().getMap().startMapEffect("Please find the hidden door by investigating the Lab!", 5120021);
                        break;
                    case 926100001:
                        c.getPlayer().getMap().startMapEffect("Find  your way through this darkness!", 5120021);
                        break;
                    case 926100100:
                        c.getPlayer().getMap().startMapEffect("Fill the beakers to power the energy!", 5120021);
                        break;
                    case 926100200:
                        c.getPlayer().getMap().startMapEffect("Get the files for the experiment through each door!", 5120021);
                        break;
                    case 926100203:
                        c.getPlayer().getMap().startMapEffect("Please defeat all the monsters!", 5120021);
                        break;
                    case 926100300:
                        c.getPlayer().getMap().startMapEffect("Find your way through the Lab!", 5120021);
                        break;
                    case 926100401:
                        c.getPlayer().getMap().startMapEffect("Please, protect my love!", 5120021);
                        break;
                }
                break;
            }
            case "StageMsg_juliet": {
                switch (c.getPlayer().getMapId()) {
                    case 926110000:
                        c.getPlayer().getMap().startMapEffect("Please find the hidden door by investigating the Lab!", 5120022);
                        break;
                    case 926110001:
                        c.getPlayer().getMap().startMapEffect("Find  your way through this darkness!", 5120022);
                        break;
                    case 926110100:
                        c.getPlayer().getMap().startMapEffect("Fill the beakers to power the energy!", 5120022);
                        break;
                    case 926110200:
                        c.getPlayer().getMap().startMapEffect("Get the files for the experiment through each door!", 5120022);
                        break;
                    case 926110203:
                        c.getPlayer().getMap().startMapEffect("Please defeat all the monsters!", 5120022);
                        break;
                    case 926110300:
                        c.getPlayer().getMap().startMapEffect("Find your way through the Lab!", 5120022);
                        break;
                    case 926110401:
                        c.getPlayer().getMap().startMapEffect("Please, protect my love!", 5120022);
                        break;
                }
                break;
            }
            case "party6weatherMsg": {
                switch (c.getPlayer().getMapId()) {
                    case 930000000:
                        c.getPlayer().getMap().startMapEffect("Step in the portal to be transformed.", 5120023);
                        break;
                    case 930000100:
                        c.getPlayer().getMap().startMapEffect("Defeat the poisoned monsters!", 5120023);
                        break;
                    case 930000200:
                        c.getPlayer().getMap().startMapEffect("Eliminate the spore that blocks the way by purifying the poison!", 5120023);
                        break;
                    case 930000300:
                        c.getPlayer().getMap().startMapEffect("Uh oh! The forest is too confusing! Find me, quick!", 5120023);
                        break;
                    case 930000400:
                        c.getPlayer().getMap().startMapEffect("Purify the monsters by getting Purification Marbles from me!", 5120023);
                        break;
                    case 930000500:
                        c.getPlayer().getMap().startMapEffect("Find the Purple Magic Stone!", 5120023);
                        break;
                    case 930000600:
                        c.getPlayer().getMap().startMapEffect("Place the Magic Stone on the altar!", 5120023);
                        break;
                }
                break;
            }
            case "prisonBreak_mapEnter": {
                switch (c.getPlayer().getMapId()) {
                    case 921160100:
                        c.getPlayer().getMap().startMapEffect("嘘！必须悄悄地避开障碍物，从塔里出去。", 5120053);
                        break;

                    case 921160200:
                        c.getPlayer().getMap().startMapEffect("必须消灭所有警卫。否则他们会叫来其他警卫。", 5120053);
                        break;

                    case 921160300:
                        c.getPlayer().getMap().startMapEffect("为了防止有人接近监狱，他们建造了迷宫。请寻找通往空中监狱的门！", 5120053);
                        break;

                    case 921160400:
                        c.getPlayer().getMap().startMapEffect("必须消灭所有警卫。否则他们会叫来其他警卫。", 5120053);
                        break;

                    case 921160500:
                        c.getPlayer().getMap().startMapEffect("这是最后的障碍物。请通过障碍物，到空中监狱来。", 5120053);
                        break;

                    case 921160600:
                        c.getPlayer().getMap().startMapEffect("请消灭警卫，找到监狱钥匙，打开监狱门。", 5120053);
                        break;

                    case 921160700:
                        c.getPlayer().getMap().startMapEffect("请消灭看守，让我们重获自由！！！！", 5120053);
                        break;

                }
                break;
            }
            case "StageMsg_davy": {
                switch (c.getPlayer().getMapId()) {
                    case 925100000:
                        c.getPlayer().getMap().startMapEffect("必须在限定时间内消灭所有怪物，登上海盗船！", 5120020);
                        break;

                    case 925100100:
                        c.getPlayer().getMap().startMapEffect("搜集所有海盗的证物。。", 5120020);
                        break;

                    case 925100200:
                        c.getPlayer().getMap().startMapEffect("Defeat the guards here to pass!", 5120020);
                        break;

                    case 925100300:
                        c.getPlayer().getMap().startMapEffect("Eliminate the guards here to pass!", 5120020);
                        break;

                    case 925100400:
                        c.getPlayer().getMap().startMapEffect("在限定时间内从怪物身上搜集钥匙，关上所有的门！!", 5120020);
                        break;

                    case 925100500:
                        c.getPlayer().getMap().startMapEffect("好了，这是最后一次。击败红鼻子海盗团的船长老海盗！", 5120020);
                        break;
                }
                final EventManager em = c.getChannelServer().getEventSM().getEventManager("Pirate");
                if (c.getPlayer().getMapId() == 925100500 && em != null && em.getProperty("stage5") != null) {
                    int mobId = Randomizer.nextBoolean() ? 9300107 : 9300119; //lord pirate
                    final int st = Integer.parseInt(em.getProperty("stage5"));
                    switch (st) {
                        case 1:
                            mobId = Randomizer.nextBoolean() ? 9300119 : 9300105; //angry
                            break;
                        case 2:
                            mobId = Randomizer.nextBoolean() ? 9300106 : 9300105; //enraged
                            break;
                    }
                    MapleMonster shammos = MapleLifeFactory.getMonster(mobId);
                    if (c.getPlayer().getEventInstance() != null) {
                        c.getPlayer().getEventInstance().registerMonster(shammos);
                    }
                    c.getPlayer().getMap().spawnMonsterOnGroundBelow(shammos, new Point(411, 236));
                }
                break;
            }
            case "astaroth_summon": {
                c.getPlayer().getMap().resetFully();
                break;
            }
            case "boss_Ravana_mirror":
            case "boss_Ravana": { //event handles this so nothing for now until i find out something to do with it
                c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.serverEvent("拉瓦特出现了。"));
                break;
            }
            case "killing_BonusSetting": { //spawns monsters according to mapid
                //910320010-910320029 = Train 999 bubblings.
                //926010010-926010029 = 30 Yetis
                //926010030-926010049 = 35 Yetis
                //926010050-926010069 = 40 Yetis
                //926010070-926010089 - 50 Yetis (specialized? immortality)
                //TODO also find positions to spawn these at
                c.getPlayer().getMap().resetFully();
                c.announce(MaplePacketCreator.showEffect("killing/bonus/bonus"));
                c.announce(MaplePacketCreator.showEffect("killing/bonus/stage"));
                Point pos1 = null, pos2 = null, pos3 = null;
                int spawnPer = 0;
                int mobId = 0;
                //9700019, 9700029
                //9700021 = one thats invincible
                if (c.getPlayer().getMapId() >= 910320010 && c.getPlayer().getMapId() <= 910320029) {
                    pos1 = new Point(121, 218);
                    pos2 = new Point(396, 43);
                    pos3 = new Point(-63, 43);
                    mobId = 9700020;
                    spawnPer = 10;
                } else if (c.getPlayer().getMapId() >= 926010010 && c.getPlayer().getMapId() <= 926010029) {
                    pos1 = new Point(0, 88);
                    pos2 = new Point(-326, -115);
                    pos3 = new Point(361, -115);
                    mobId = 9700019;
                    spawnPer = 10;
                } else if (c.getPlayer().getMapId() >= 926010030 && c.getPlayer().getMapId() <= 926010049) {
                    pos1 = new Point(0, 88);
                    pos2 = new Point(-326, -115);
                    pos3 = new Point(361, -115);
                    mobId = 9700019;
                    spawnPer = 15;
                } else if (c.getPlayer().getMapId() >= 926010050 && c.getPlayer().getMapId() <= 926010069) {
                    pos1 = new Point(0, 88);
                    pos2 = new Point(-326, -115);
                    pos3 = new Point(361, -115);
                    mobId = 9700019;
                    spawnPer = 20;
                } else if (c.getPlayer().getMapId() >= 926010070 && c.getPlayer().getMapId() <= 926010089) {
                    pos1 = new Point(0, 88);
                    pos2 = new Point(-326, -115);
                    pos3 = new Point(361, -115);
                    mobId = 9700029;
                    spawnPer = 20;
                } else {
                    break;
                }
                for (int i = 0; i < spawnPer; i++) {
                    c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(pos1));
                    c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(pos2));
                    c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(pos3));
                }

                c.getPlayer().startMapTimeLimitTask(120, c.getPlayer().getMap().getReturnMap());
                break;
            }
            case "mPark_summonBoss": {
                if (c.getPlayer().getEventInstance() != null && c.getPlayer().getEventInstance().getProperty("boss") != null && c.getPlayer().getEventInstance().getProperty("boss").equals("0")) {
                    for (int i = 9800119; i < 9800125; i++) {
                        final MapleMonster boss = MapleLifeFactory.getMonster(i);
                        c.getPlayer().getEventInstance().registerMonster(boss);
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(boss, new Point(c.getPlayer().getMap().getPortal(2).getPosition()));
                    }
                }
                break;
            }
            case "shammos_Fenter": {
                if (c.getPlayer().getMapId() >= 921120005 && c.getPlayer().getMapId() < 921120500) {
                    MapleMonster shammos = MapleLifeFactory.getMonster(9300275);
                    if (c.getPlayer().getEventInstance() != null) {
                        int averageLevel = 0, size = 0;
                        for (MapleCharacter pl : c.getPlayer().getEventInstance().getPlayers()) {
                            averageLevel += pl.getLevel();
                            size++;
                        }
                        if (size <= 0) {
                            return;
                        }
                        averageLevel /= size;
                        shammos.changeLevel(averageLevel);
                        c.getPlayer().getEventInstance().registerMonster(shammos);
                        if (c.getPlayer().getEventInstance().getProperty("HP") == null) {
                            c.getPlayer().getEventInstance().setProperty("HP", averageLevel + "000");
                        }
                        shammos.setHp(Long.parseLong(c.getPlayer().getEventInstance().getProperty("HP")));
                    }
                    c.getPlayer().getMap().spawnMonsterWithEffectBelow(shammos, new Point(c.getPlayer().getMap().getPortal(0).getPosition()), 12);
                    shammos.switchController(c.getPlayer(), false);
                    c.announce(MobPacket.mobEscortReturnBefore(shammos, c.getPlayer().getMap()));
                    break;
                }

                if (c.getPlayer().getMapId() == (ServerConstants.GMS ? 921120300 : 921120500) && c.getPlayer().getMap().getAllMonstersThreadsafe().size() == 0) {
                    final MapleMonster shammos = MapleLifeFactory.getMonster(9300281);
                    if (c.getPlayer().getEventInstance() != null) {
                        int averageLevel = 0, size = 0;
                        for (MapleCharacter pl : c.getPlayer().getEventInstance().getPlayers()) {
                            averageLevel += pl.getLevel();
                            size++;
                        }
                        if (size <= 0) {
                            return;
                        }
                        averageLevel /= size;
                        shammos.changeLevel(Math.max(120, Math.min(200, averageLevel)));
                    }
                    c.getPlayer().getMap().spawnMonsterOnGroundBelow(shammos, new Point(350, 170));
                }
                break;
            }
            //5120038 =  dr bing. 5120039 = visitor lady. 5120041 = unknown dr bing.
            case "iceman_FEnter": {
                if (c.getPlayer().getMapId() >= 932000100 && c.getPlayer().getMapId() < 932000300) {
                    final MapleMonster shammos = MapleLifeFactory.getMonster(9300438);
                    if (c.getPlayer().getEventInstance() != null) {
                        int averageLevel = 0, size = 0;
                        for (MapleCharacter pl : c.getPlayer().getEventInstance().getPlayers()) {
                            averageLevel += pl.getLevel();
                            size++;
                        }
                        if (size <= 0) {
                            return;
                        }
                        averageLevel /= size;
                        shammos.changeLevel(averageLevel);
                        c.getPlayer().getEventInstance().registerMonster(shammos);
                        shammos.getChangedStats().setOHp(averageLevel * 100);
                        shammos.setHp(averageLevel * 100);
                        if (c.getPlayer().getEventInstance().getProperty("HP") == null) {
                            c.getPlayer().getEventInstance().setProperty("HP", averageLevel + "000");
                        }
                        shammos.setHp(Long.parseLong(c.getPlayer().getEventInstance().getProperty("HP")));
                    }
                    c.getPlayer().getMap().spawnMonsterWithEffectBelow(shammos, new Point(c.getPlayer().getMap().getPortal(0).getPosition()), 12);
                    shammos.switchController(c.getPlayer(), false);
                    c.announce(MobPacket.mobEscortReturnBefore(shammos, c.getPlayer().getMap()));
                }
                break;
            }
            case "PRaid_D_Fenter": {
                switch (c.getPlayer().getMapId() % 10) {
                    case 0:
                        c.getPlayer().getMap().startMapEffect("请消灭所有怪物!", 5120033);
                        break;

                    case 1:
                        c.getPlayer().getMap().startMapEffect("打开箱子并消灭怪物!", 5120033);
                        break;

                    case 2:
                        c.getPlayer().getMap().startMapEffect("请消灭警官!", 5120033);
                        break;

                    case 3:
                        c.getPlayer().getMap().startMapEffect("请消灭所有怪物!", 5120033);
                        break;

                    case 4:
                        c.getPlayer().getMap().startMapEffect("找到通往下一关的路!", 5120033);
                        break;

                }
                break;
            }
            case "PRaid_B_Fenter": {
                c.getPlayer().getMap().startMapEffect("请打败幽灵船长!", 5120033);
                break;
            }
            case "summon_pepeking": {
                c.getPlayer().getMap().resetFully();
                final int rand = Randomizer.nextInt(10);
                int mob_ToSpawn = 100100;
                if (rand >= 4) { //60%
                    mob_ToSpawn = 3300007;
                } else if (rand >= 1) {
                    mob_ToSpawn = 3300006;
                } else {
                    mob_ToSpawn = 3300005;
                }
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mob_ToSpawn), c.getPlayer().getPosition());
                break;
            }
            case "Xerxes_summon": {
                c.getPlayer().getMap().resetFully();
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(6160003), c.getPlayer().getPosition());
                break;
            }
            case "shammos_FStart":
                c.getPlayer().getMap().startMapEffect("请消灭怪物!", 5120035);
                break;
            case "kenta_mapEnter": {
                switch (c.getPlayer().getMapId() / 100 % 10) {
                    case 1:
                        c.getPlayer().getMap().startMapEffect("你能听见我的声音吗？请帮帮我！！我在受难船附近……", 5120052);
                        break;

                    case 2:
                        c.getPlayer().getMap().startMapEffect("海洋生物变得狂暴的原因究竟是什么呢……", 5120052);
                        final MapleMonster monster6 = MapleLifeFactory.getMonster(9300460);
                        monster6.setHp(Long.parseLong(c.getPlayer().getEventInstance().getProperty("HP")));
                        c.getPlayer().getEventInstance().registerMonster(monster6);
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(monster6, new Point(c.getPlayer().getMap().getPortal(0).getPosition()));
                        monster6.switchController(c.getPlayer(), false);
                        c.announce(MobPacket.mobEscortReturnBefore(monster6, c.getPlayer().getMap()));
                        c.getPlayer().send_other(UIPacket.showPQEffect(3, "cave1", "0"), true);
                        c.getPlayer().send_other(UIPacket.showPQEffect(3, "cave2", "0"), true);
                        c.getPlayer().send_other(UIPacket.showPQEffect(3, "cave3", "0"), true);
                        c.getPlayer().send_other(UIPacket.showPQEffect(3, "cave4", "0"), true);
                        break;

                    case 3:
                        if (!c.getPlayer().getMap().containsNPC(9020004)) {
                            c.getPlayer().getMap().spawnNpc(9020004, new Point(147, 168));
                        }
                        break;

                    case 4:
                        c.getPlayer().getMap().startMapEffect("这么大的鱼……这就是皮亚奴斯？而且还是2条！！它们在攻击我们！请消灭掉它们！！", 5120052);
                        break;

                }
                break;
            }
            case "cygnus_Summon": {
                if (c.getPlayer().getEventInstance() == null || !c.getPlayer().getEventInstance().getProperty("mapEffect").equals("0"))
                    break;
                c.getPlayer().getEventInstance().setProperty("mapEffect", "1");
                c.getPlayer().getMap().startMapEffect("很久没看到有人来了，但是也没看到有人可以回去。", 5120043);
                break;
            }
            case "iceman_Boss": {
                c.getPlayer().getMap().startMapEffect("你将会灭亡!", 5120050);
                break;
            }
            case "Visitor_Cube_poison": {
                c.getPlayer().getMap().startMapEffect("请消灭所有怪物!!!", 5120039);
                break;
            }
            case "Visitor_Cube_Hunting_Enter_First": {
                c.getPlayer().getMap().startMapEffect("Eliminate all the Visitors!", 5120039);
                break;
            }
            case "VisitorCubePhase00_Start": {
                c.getPlayer().getMap().startMapEffect("Eliminate all the flying monsters!", 5120039);
                break;
            }
            case "visitorCube_addmobEnter": {
                c.getPlayer().getMap().startMapEffect("Eliminate all the monsters by moving around the map!", 5120039);
                break;
            }
            case "Visitor_Cube_PickAnswer_Enter_First_1": {
                c.getPlayer().getMap().startMapEffect("One of the aliens must have a clue to the way out.", 5120039);
                break;
            }
            case "visitorCube_medicroom_Enter": {
                c.getPlayer().getMap().startMapEffect("Eliminate all of the Unjust Visitors!", 5120039);
                break;
            }
            case "visitorCube_iceyunna_Enter": {
                c.getPlayer().getMap().startMapEffect("Eliminate all of the Speedy Visitors!", 5120039);
                break;
            }
            case "Visitor_Cube_AreaCheck_Enter_First": {
                c.getPlayer().getMap().startMapEffect("The switch at the top of the room requires a heavy weight.", 5120039);
                break;
            }
            case "visitorCube_boomboom_Enter": {
                c.getPlayer().getMap().startMapEffect("The enemy is powerful! Watch out!", 5120039);
                break;
            }
            case "visitorCube_boomboom2_Enter": {
                c.getPlayer().getMap().startMapEffect("This Visitor is strong! Be careful!", 5120039);
                break;
            }
            case "CubeBossbang_Enter": {
                c.getPlayer().getMap().startMapEffect("This is it! Give it your best shot!", 5120039);
                break;
            }
            case "MalayBoss_Int":
            case "storymap_scenario":
            case "dojang_Msg":
            case "balog_summon":
            case "easy_balog_summon": { //we dont want to reset
                break;
            }
            case "metro_firstSetting":
            case "killing_MapSetting":
            case "Sky_TrapFEnter":
            case "balog_bonusSetting": { //not needed
                c.getPlayer().getMap().resetFully();
                break;
            }
            case "magnus_summon_E":
            case "magnus_summon": {
                break;
            }
            default: {
//                log.info("地图触发: 未找到 " + scriptName + ", 类型: onFirstUserEnter - 地图ID " + c.getPlayer().getMapId());
                NPCScriptManager.getInstance().onFirstUserEnter(c, scriptName);
                break;
            }
        }
        if (bl2) {
            c.getPlayer().updateMapScript(MapScriptType.onFirstUserEnter, scriptName);
        } else {
            c.getPlayer().updateMapScript(MapScriptType.UNK, scriptName);
        }
    }

    private static void sendDojoClock(MapleClient c, int time) {
        c.announce(MaplePacketCreator.getClock(time));
    }

    private static void sendDojoStart(MapleClient c, int stage) {
        c.announce(MaplePacketCreator.environmentChange("Dojang/start", 0x05));
        c.announce(MaplePacketCreator.environmentChange("dojang/start/stage", 0x0C));
        c.announce(MaplePacketCreator.environmentChange("dojang/start/number/" + stage, 0x0C));
        if (stage == 1) {
            c.getPlayer().getMap().startMapEffect("别忘了限制时间是10分钟，只要在时间内打倒怪物，进入下一层就行！", 5120024);
        }
        //c.announce(MaplePacketCreator.trembleEffect(0, 1));
    }

    private static void handlePinkBeanStart(MapleClient c) {
        MapleMap map = c.getPlayer().getMap();
        map.resetFully();
        if (c.getPlayer().getEventInstance() != null && !map.containsNPC(2141000) && c.getPlayer().getEventInstance().getProperty("summon").equals("0")) {
            map.spawnNpc(2141000, new Point(-190, -42));
            c.getPlayer().getEventInstance().setProperty("summon", "1");
        }
    }

    private static void handleRanmaru_Before(MapleClient c) {
        MapleMap map = c.getPlayer().getMap();
        if (c.getPlayer().getEventInstance() != null && !map.containsNPC(9130090) && c.getPlayer().getEventInstance().getProperty("summoned").equals("0")) {
            map.resetFully();
            if (!map.containsNPC(9130090)) {
                map.spawnNpc(9130090, new Point(-382, 123));
            }
        }
    }

    private static int getTiming(int ids) {
        if (ids <= 5) {
            return 5;
        } else if (ids >= 7 && ids <= 11) {
            return 6;
        } else if (ids >= 13 && ids <= 17) {
            return 7;
        } else if (ids >= 19 && ids <= 23) {
            return 8;
        } else if (ids >= 25 && ids <= 29) {
            return 9;
        } else if (ids >= 31 && ids <= 35) {
            return 10;
        } else if (ids >= 37 && ids <= 38) {
            return 15;
        }
        return 0;
    }

    private static int getDojoStageDec(int ids) {
        if (ids <= 5) {
            return 0;
        } else if (ids >= 7 && ids <= 11) {
            return 1;
        } else if (ids >= 13 && ids <= 17) {
            return 2;
        } else if (ids >= 19 && ids <= 23) {
            return 3;
        } else if (ids >= 25 && ids <= 29) {
            return 4;
        } else if (ids >= 31 && ids <= 35) {
            return 5;
        } else if (ids >= 37 && ids <= 38) {
            return 6;
        }
        return 0;
    }

    public static void startScript_User(final MapleClient c, String scriptName) {
        if (c.getPlayer() == null) {
            return;
        } //o_O
        String data = "";
        if (c.getPlayer().isShowPacket()) {
            log.info("[地图脚本] 执行onUserEnter: " + scriptName);
        }
        boolean bl2 = false;
        switch (scriptName) {
            case "dojang_QcheckSet":
                break;
            case "VanLeon_ExpeditionEnter":
                c.getPlayer().sendDathCount();
                break;
            case "direction_59070b":
                try {
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 9390336, "BeastTamerQuestLine4");
                    Thread.sleep(2000);
                } catch (InterruptedException var7_7) {
                    // empty catch block
                }
                c.announce(UIPacket.IntroEnableUI(0));
                c.announce(UIPacket.IntroDisableUI(false));
                break;
            case "direction_59070":
                c.announce(UIPacket.inGameCurNodeEventEnd(true));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9390336, "BeastTamerQuestLine3");
                break;
            case "direction_59063":
                try {
                    if (c.getPlayer().getQuestStatus(59063) == 1) {
                        MapleQuest.getInstance(59063).forceComplete(c.getPlayer(), 0);
                    }
                    c.announce(UIPacket.getTopMsg("On voyage to Nautilus."));
                    c.announce(MaplePacketCreator.getClock(30));
                    Thread.sleep(30000);
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(866000240);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                } catch (InterruptedException var7_9) {
                }
                break;
            case "direction_59061":
                if (c.getPlayer().getQuestStatus(59061) == 1) {
                    MapleQuest.getInstance(59061).forceComplete(c.getPlayer(), 0);
                    break;
                }
                break;
            case "enter_866033000":
                c.getPlayer().getMap().resetFully();
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390915), new Point(-153, 49));
                break;
            case "direction_59054":
                try {
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    c.announce(UIPacket.IntroEnableUI(0));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 100));
                    Thread.sleep(100);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfoNew((byte) 0, 500, 575, 865));
                    c.announce(UIPacket.getDirectionInfo(1, 2825));
                    Thread.sleep(2825);
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 9390313, "BeastTamerQuestLine1");
                } catch (InterruptedException var7_10) {
                }
                break;
            case "onUserEnter_866191000":
                c.announce(UIPacket.inGameCurNodeEventEnd(true));
                c.announce(UIPacket.IntroEnableUI(0));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9390301, "BeastTamerTutIntro1");
                break;
            case "onUserEnter_866138000": {
                try {
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.playMovie("BeastTamer.avi", true));
                    Thread.sleep(75000);
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(866191000);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                } catch (InterruptedException var7_12) {
                }
                break;
            }
            case "onUserEnter_866135000":
                c.announce(UIPacket.inGameCurNodeEventEnd(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.IntroDisableUI(true));
                if (c.getPlayer().haveItem(2500004, 0)) {
                    c.getPlayer().gainItem(2500004, 1, "地图脚本获得");
                    HashMap<Integer, SkillEntry> skills = new HashMap<>();
                    skills.put(110000012, new SkillEntry(14, (byte) 14, -1));
                    skills.put(110001506, new SkillEntry(1, (byte) 1, -1));
                    skills.put(110001514, new SkillEntry(1, (byte) 1, -1));
                    skills.put(110001510, new SkillEntry(1, (byte) 1, -1));
                    skills.put(110001500, new SkillEntry(1, (byte) 1, -1));
                    skills.put(110001502, new SkillEntry(1, (byte) 1, -1));
                    skills.put(112100000, new SkillEntry(1, (byte) 14, -1));
                    skills.put(110001501, new SkillEntry(1, (byte) 1, -1));
                    skills.put(110001501, new SkillEntry(1, (byte) 1, -1));
                    skills.put(112000000, new SkillEntry(1, (byte) 14, -1));
                    c.getPlayer().changeSkillsLevel(skills);
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9390300, "BeastTamerTutIntro");
                break;
            case "onUserEnter_866109000": {
                MapleQuest.getInstance(59008).forceComplete(c.getPlayer(), 0);
                MapleQuest.getInstance(59009).forceStart(c.getPlayer(), 0, null);
                MapleQuest.getInstance(59009).forceComplete(c.getPlayer(), 0);
                MapleQuest.getInstance(59011).forceStart(c.getPlayer(), 0, null);
                MapleQuest.getInstance(59011).forceComplete(c.getPlayer(), 0);
                MapleQuest.getInstance(59013).forceStart(c.getPlayer(), 0, null);
                MapleQuest.getInstance(59013).forceComplete(c.getPlayer(), 0);
                MapleQuest.getInstance(59015).forceStart(c.getPlayer(), 0, null);
                MapleQuest.getInstance(59015).forceComplete(c.getPlayer(), 0);
                MapleQuest.getInstance(59016).forceStart(c.getPlayer(), 0, null);
                MapleQuest.getInstance(59016).forceComplete(c.getPlayer(), 0);
                MapleMap map = c.getChannelServer().getMapFactory().getMap(866135000);
                c.getPlayer().changeMap(map, map.getPortal(0));
                break;
            }
            case "onUserEnter_866107000":
                try {
                    c.getPlayer().getMap().resetFully();
                    if (c.getPlayer().getQuestStatus(59005) == 1) {
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390931), new Point(661, 246));
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390931), new Point(761, 246));
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390931), new Point(861, 246));
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390931), new Point(961, 246));
                        c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390931), new Point(1061, 246));
                    }
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 9390300, "BeastTamerTut06");
                    Thread.sleep(1000);
                    MapleQuest.getInstance(59005).forceComplete(c.getPlayer(), 0);
                } catch (InterruptedException var7_15) {
                }
                break;
            case "onUserEnter_866106000": {
                try {
                    c.getPlayer().getMap().resetFully();
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.IntroDisableUI(true));
                    if (!c.getPlayer().getMap().containsNPC(9390381)) {
                        c.getPlayer().getMap().spawnNpc(9390381, new Point(89, 32));
                    }
                    c.announce(NPCPacket.setNPCSpecialAction(9390381, "summon"));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 9390381, "BeastTamerTut05");
                    Thread.sleep(6000);
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(866107000);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                } catch (InterruptedException var7_17) {
                }
                break;
            }
            case "onUserEnter_866105000":
                c.announce(UIPacket.IntroEnableUI(0));
                c.announce(UIPacket.IntroDisableUI(false));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390936), new Point(515, 77));
                break;
            case "onUserEnter_866104000": {
                try {
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.getDirectionInfo(1, 300));
                    Thread.sleep(300);
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 9390300, "BeastTamerTut04");
                    Thread.sleep(6000);
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(866105000);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                } catch (InterruptedException var7_19) {
                }
                break;
            }
            case "onUserEnter_866103000":
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390937), new Point(515, 77));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9390935), new Point(278, 70));
                c.announce(UIPacket.inGameCurNodeEventEnd(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.IntroDisableUI(true));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9390300, "BeastTamerTut03");
                break;
            case "onUserEnter_866100000":
                c.announce(UIPacket.inGameCurNodeEventEnd(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.IntroDisableUI(true));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9390305, "BeastTamerTut01");
                break;
            case "q59000_tuto":
                try {
                    c.announce(UIPacket.IntroEnableUI(0));
                    c.announce(UIPacket.IntroDisableUI(false));
                    c.announce(MaplePacketCreator.sendHint("Press #e#b[left],[right]#k#n to move around.", 150, 5));
                    Thread.sleep(5000);
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 1103005, "TotInfoBT");
                    MapleQuest.getInstance(28862).forceStart(c.getPlayer(), 0, null);
                    MapleQuest.getInstance(28862).forceComplete(c.getPlayer(), 0);
                    c.announce(UIPacket.getTopMsg("Earned Forever Single title!"));
                } catch (InterruptedException var7_20) {
                }
                break;
            case "Advanture_tuto33":
                c.getPlayer().getMap().resetFully();
                c.announce(UIPacket.getTopMsg("請擊退紅寶王."));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300815), new Point(0, 0));
                break;
            case "root_camera":
                if (c.getPlayer().getQuestStatus(30000) == 1) {
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 1064026, "AbyssTut01");
                    break;
                }
                break;
            case "root_ereb00":
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.IntroDisableUI(true));
                if (!c.getPlayer().getMap().containsNPC(1064026)) {
                    c.getPlayer().getMap().spawnNpc(1064026, new Point(-113, 88));
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1064026, "AbyssTut00");
                break;
            case "enter_101072002":
                c.getPlayer().getMap().resetFully();
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.IntroDisableUI(true));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1500004, null);
                break;
            case "enter_101073300":
                c.getPlayer().getMap().resetFully();
                if (c.getPlayer().getQuestStatus(32128) == 1) {
                    MapleQuest.getInstance(32128).forceComplete(c.getPlayer(), 0);
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1500016, null);
                break;
            case "enter_101073201":
                c.getPlayer().getMap().resetFully();
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.IntroDisableUI(true));
                if (!c.getPlayer().getMap().containsNPC(1500026)) {
                    c.getPlayer().getMap().spawnNpc(1500026, new Point(-369, 245));
                }
                if (!c.getPlayer().getMap().containsNPC(1500031)) {
                    c.getPlayer().getMap().spawnNpc(1500031, new Point(55, 245));
                }
                if (!c.getPlayer().getMap().containsNPC(1500032)) {
                    c.getPlayer().getMap().spawnNpc(1500032, new Point(200, 245));
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1500026, null);
                break;
            case "enter_101073110":
                c.getPlayer().getMap().resetFully();
                if (c.getPlayer().getQuestStatus(32126) == 1) {
                    MapleQuest.getInstance(32126).forceComplete(c.getPlayer(), 0);
                }
                c.announce(MaplePacketCreator.getClock(600));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1500019, null);
                break;
            case "enter_101073010":
                c.getPlayer().getMap().resetFully();
                if (c.getPlayer().getQuestStatus(32123) == 1) {
                    MapleQuest.getInstance(32123).forceComplete(c.getPlayer(), 0);
                }
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-187, 245));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-187, 245));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-187, 245));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-187, 245));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-187, 245));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-53, 185));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-53, 185));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-53, 185));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-53, 185));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(3501006), new Point(-53, 185));
                c.announce(MaplePacketCreator.getClock(600));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1500017, null);
                break;
            case "enter_101070000":
                try {
                    c.announce(UIPacket.getTopMsg("The forest of fairies seems to materialize from nowhere as you exit the passage."));
                    Thread.sleep(2000);
                } catch (InterruptedException var7_21) {
                    // empty catch block
                }
                c.announce(MaplePacketCreator.showEffect("temaD/enter/fairyAcademy"));
                break;
            case "evolvingDirection1":
                try {
                    MapleQuest.getInstance(1801).forceStart(c.getPlayer(), 9075005, null);
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(MaplePacketCreator.showEffect("evolving/mapname"));
                    Thread.sleep(4000);
                } catch (InterruptedException var7_22) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9075005, "TutEvolving1");
                break;
            case "evolvingDirection2":
                try {
                    MapleQuest.getInstance(1801).forceComplete(c.getPlayer(), 0);
                    c.getPlayer().getMap().resetFully();
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(MaplePacketCreator.showEffect("evolving/swoo1"));
                    if (!c.getPlayer().getMap().containsNPC(9075004)) {
                        c.getPlayer().getMap().spawnNpc(9075004, new Point(70, 136));
                    }
                    Thread.sleep(14000);
                } catch (InterruptedException var7_23) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9075004, "TutEvolving2");
                break;
            case "enter_931060110":
                c.getPlayer().saveLocation(SavedLocationType.fromString("TUTORIAL"));
                try {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 1200));
                    Thread.sleep(1200);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 30));
                    Thread.sleep(30);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                } catch (InterruptedException var7_24) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9072200, "enter_931060110");
            case "enter_931060120":
                c.getPlayer().saveLocation(SavedLocationType.fromString("TUTORIAL"));
                try {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 1200));
                    Thread.sleep(1200);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 30));
                    Thread.sleep(30);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                } catch (InterruptedException var7_25) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9072200, "enter_931060120");
            case "rootabyssTakeItem":
                break;

            case "cannon_tuto_direction": {
                showIntro(c, "Effect/Direction4.img/cannonshooter/Scene00");
                showIntro(c, "Effect/Direction4.img/cannonshooter/out00");
                break;
            }
            case "cannon_tuto_direction1": {
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.IntroLock(true));
                c.announce(UIPacket.getDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/0", 5000, 0, 0, 1));
                c.announce(UIPacket.getDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/1", 5000, 0, 0, 1));
                c.announce(UIPacket.getDirectionInfo("Effect/Direction4.img/effect/cannonshooter/balloon/2", 5000, 0, 0, 1));
                c.announce(EffectPacket.ShowWZEffect("Effect/Direction4.img/cannonshooter/face04"));
                c.announce(EffectPacket.ShowWZEffect("Effect/Direction4.img/cannonshooter/out01"));
                c.announce(UIPacket.getDirectionInfo(1, 5000));
                break;
            }
            case "cannon_tuto_direction2": {
                showIntro(c, "Effect/Direction4.img/cannonshooter/Scene01");
                showIntro(c, "Effect/Direction4.img/cannonshooter/out02");
                break;
            }
            case "cygnusTest": {
                showIntro(c, "Effect/Direction.img/cygnus/Scene" + (c.getPlayer().getMapId() == 913040006 ? 9 : (c.getPlayer().getMapId() - 913040000)));
                break;
            }
            case "cygnusJobTutorial": {
                showIntro(c, "Effect/Direction.img/cygnusJobTutorial/Scene" + (c.getPlayer().getMapId() - 913040100));
                break;
            }
            case "shammos_Enter": { //nothing to go on inside the map
                if (c.getPlayer().getEventInstance() != null && c.getPlayer().getMapId() == 921120500) {
                    NPCScriptManager.getInstance().dispose(c); //only boss map.
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 2022006);
                }
                break;
            }
            case "iceman_Enter": { //nothing to go on inside the map
                if (c.getPlayer().getEventInstance() != null && c.getPlayer().getMapId() == 932000300) {
                    NPCScriptManager.getInstance().dispose(c); //only boss map.
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 2159020);
                }
                break;
            }
            case "start_itemTake": { //nothing to go on inside the map
                final EventManager em = c.getChannelServer().getEventSM().getEventManager("OrbisPQ");
                if (em != null && em.getProperty("pre").equals("0")) {
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 2013001);
                    c.getPlayer().getMap().startMapEffect("\u8bf7\u6536\u96c6\u4e91\u7247\u6765\u6551\u6211!!", 5120019);
                }
                break;
            }
            case "WUorbisPQ_1stIn": {
                EventManager em = c.getChannelServer().getEventSM().getEventManager("OrbisPQ");
                if (em != null && em.getProperty("pre").equals("0")) {
                    NPCScriptManager.getInstance().dispose(c);
                    c.removeClickedNPC();
                    NPCScriptManager.getInstance().start(c, 9076131, null);
                    break;
                }
                break;
            }
            case "PRaid_W_Enter": {
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_expPenalty", "0"));
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_ElapssedTimeAtField", "0"));
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_Point", "-1"));
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_Bonus", "-1"));
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_Total", "-1"));
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_Team", ""));
                c.announce(MaplePacketCreator.sendPyramidEnergy("PRaid_IsRevive", "0"));
                c.getPlayer().writePoint("PRaid_Point", "-1");
                c.getPlayer().writeStatus("Red_Stage", "1");
                c.getPlayer().writeStatus("Blue_Stage", "1");
                c.getPlayer().writeStatus("redTeamDamage", "0");
                c.getPlayer().writeStatus("blueTeamDamage", "0");
                break;
            }
            case "jail": {
                if (!c.getPlayer().isIntern()) {
                    c.getPlayer().getQuestNAdd(MapleQuest.getInstance(GameConstants.JAIL_TIME)).setCustomData(String.valueOf(System.currentTimeMillis()));
                    final MapleQuestStatus stat = c.getPlayer().getQuestNAdd(MapleQuest.getInstance(GameConstants.JAIL_QUEST));
                    if (stat.getCustomData() != null) {
                        final int seconds = Integer.parseInt(stat.getCustomData());
                        if (seconds > 0) {
                            c.getPlayer().startMapTimeLimitTask(seconds, c.getChannelServer().getMapFactory().getMap(100000000));
                        }
                    }
                }
                break;
            }
            case "TD_neo_BossEnter":
            case "findvioleta": {
                c.getPlayer().getMap().resetFully();
                break;
            }
            case "StageMsg_crack":
                if (c.getPlayer().getMapId() == 922010400) { //2nd stage
                    MapleMapFactory mf = c.getChannelServer().getMapFactory();
                    int q = 0;
                    for (int i = 0; i < 5; i++) {
                        q += mf.getMap(922010401 + i).getAllMonstersThreadsafe().size();
                    }
                    if (q > 0) {
                        c.getPlayer().dropMessage(-1, "There are still " + q + " monsters remaining.");
                    }
                } else if (c.getPlayer().getMapId() >= 922010401 && c.getPlayer().getMapId() <= 922010405) {
                    if (c.getPlayer().getMap().getAllMonstersThreadsafe().size() > 0) {
                        c.getPlayer().dropMessage(-1, "There are still some monsters remaining in this map.");
                    } else {
                        c.getPlayer().dropMessage(-1, "There are no monsters remaining in this map.");
                    }
                }
                break;
            case "q31102e":
                if (c.getPlayer().getQuestStatus(31102) == 1) {
                    MapleQuest.getInstance(31102).forceComplete(c.getPlayer(), 2140000);
                }
                break;
            case "q31103s":
                if (c.getPlayer().getQuestStatus(31103) == 0) {
                    MapleQuest.getInstance(31103).forceComplete(c.getPlayer(), 2142003);
                }
                break;
            case "cygnus_Minimap":
                c.announce(EffectPacket.AranTutInstructionalBalloon("Effect/OnUserEff.img/guideEffect/cygnusTutorial/0"));
                break;
            case "check_q20833":
                break;
            case "q2614M":
                if (c.getPlayer().getQuestStatus(2614) == 1) {
                    MapleQuest.getInstance(2614).forceComplete(c.getPlayer(), 0);
                }
                break;
            case "Resi_tutor20":
                c.announce(UIPacket.showMapEffect("resistance/tutorialGuide"));
                break;
            case "Resi_tutor30":
                c.announce(EffectPacket.AranTutInstructionalBalloon("Effect/OnUserEff.img/guideEffect/resistanceTutorial/userTalk"));
                break;
            case "Resi_tutor40":
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 2159012);
                break;
            case "Resi_tutor50":
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroLock(false));
                c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 2159006);
                break;
            case "Resi_tutor70":
                showIntro(c, "Effect/Direction4.img/Resistance/TalkJ");
                break;
            case "merOutStandAlone":
                if (c.getPlayer().getQuestStatus(24001) == 1) {
                    MapleQuest.getInstance(24001).forceComplete(c.getPlayer(), 0);
                    c.getPlayer().dropMessage(5, "Quest complete.");
                }
                break;
            case "np_tuto_0_5":
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(MaplePacketCreator.showEffect("phantom/back"));
                c.announce(UIPacket.getDirectionInfo(3, 4));
                c.announce(MaplePacketCreator.showEffect("newPirate/Shuttle/0"));
                try {
                    Thread.sleep(6000);
                } catch (InterruptedException var7_29) {
                    System.out.println("" + var7_29.toString());
                }
                c.announce(MaplePacketCreator.showEffect("phantom/back"));
                c.announce(MaplePacketCreator.showEffect("newPirate/TimeTravel/0"));
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException var7_30) {
                    System.out.println("" + var7_30.toString());
                }
                c.announce(MaplePacketCreator.showEffect("newPirate/text1"));
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException var7_32) {
                    System.out.println("" + var7_32.toString());
                }
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.getDirectionInfo(3, 2));
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException var7_33) {
                    System.out.println("" + var7_33.toString());
                }
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    NPCScriptManager.getInstance().start(c, 9270084, "np_tuto_0_5");
                }, 2000);
                break;
            case "np_tuto_0_8":
                c.announce(UIPacket.IntroEnableUI(1));
                if (!c.getPlayer().getMap().containsNPC(9270084)) {
                    c.getPlayer().getMap().spawnNpc(9270084, new Point(146, -120));
                }
                c.announce(UIPacket.getDirectionInfo(3, 2));
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo("Effect/DirectionNewPirate.img/effect/tuto/pirateAttack", 2000, 0, -100, 1, 0));
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException interruptedException) {
                        System.out.println("" + interruptedException.toString());
                    }
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo("Effect/DirectionNewPirate.img/newPirate/balloonMsg2/17", 2000, 0, -100, 1, 0));
                    try {
                        Thread.sleep(3000);
                    } catch (InterruptedException interruptedException) {
                        System.out.println("" + interruptedException.toString());
                    }
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(552000050);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                }, 5000);
                break;
            case "merTutorSleep00": {
                showIntro(c, "Effect/Direction5.img/mersedesTutorial/Scene0");
                Map<Integer, SkillEntry> sDate = new HashMap<>();
                sDate.put(20021181, new SkillEntry((byte) -1, (byte) 0, -1));
                sDate.put(20021166, new SkillEntry((byte) -1, (byte) 0, -1));
                sDate.put(双弩.精灵恢复, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(双弩.精灵的祝福, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(双弩.优雅移动, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(双弩.王者资格, new SkillEntry((byte) 1, (byte) 1, -1));
                c.getPlayer().changeSkillsLevel(sDate);
                break;
            }
            case "merTutorSleep01":
                while (c.getPlayer().getLevel() < 10) {
                    c.getPlayer().levelUp();
                }
                c.getPlayer().changeJob(2300);
                showIntro(c, "Effect/Direction5.img/mersedesTutorial/Scene1");
                break;
            case "merTutorSleep02":
                while (c.getPlayer().getLevel() < 10) {
                    c.getPlayer().levelUp();
                }
                c.announce(UIPacket.IntroEnableUI(0));
                break;
            case "Resi_tutor80":
            case "startEreb":
            case "mirrorCave":
            case "babyPigMap":
            case "evanleaveD": {
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroLock(false));
                c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                break;
            }
            case "dojang_Msg": {
                if (c.getPlayer().getMap().getId() == 925020000) {
                    c.getPlayer().getMap().startMapEffect(mulungEffects[Randomizer.nextInt(mulungEffects.length)], 5120024);
                } else {
                    c.getPlayer().getMap().startMapEffect("哈哈！让我看看你，我不会让你离开的。除非你先打败我！", 5120024);
                }
                break;
            }
            case "dojang_1st": {
                c.getPlayer().writeMulungEnergy();
                break;
            }
            case "undomorphdarco":
            case "reundodraco": {
                c.getPlayer().cancelEffect(MapleItemInformationProvider.getInstance().getItemEffect(2210016), false, -1);
                break;
            }
            case "goAdventure": {
                showIntro(c, "Effect/Direction3.img/goAdventure/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "crash_Dragon":
                showIntro(c, "Effect/Direction4.img/crash/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            case "getDragonEgg":
                showIntro(c, "Effect/Direction4.img/getDragonEgg/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            case "meetWithDragon":
                showIntro(c, "Effect/Direction4.img/meetWithDragon/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            case "PromiseDragon":
                showIntro(c, "Effect/Direction4.img/PromiseDragon/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            case "evanPromotion":
                switch (c.getPlayer().getMapId()) {
                    case 900090000:
                        data = "Effect/Direction4.img/promotion/Scene0" + (c.getPlayer().getGender() == 0 ? "0" : "1");
                        break;
                    case 900090001:
                        data = "Effect/Direction4.img/promotion/Scene1";
                        break;
                    case 900090002:
                        data = "Effect/Direction4.img/promotion/Scene2" + (c.getPlayer().getGender() == 0 ? "0" : "1");
                        break;
                    case 900090003:
                        data = "Effect/Direction4.img/promotion/Scene3";
                        break;
                    case 900090004:
                        c.announce(UIPacket.IntroDisableUI(false));
                        c.announce(UIPacket.IntroLock(false));
                        c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                        final MapleMap mapto = c.getChannelServer().getMapFactory().getMap(900010000);
                        c.getPlayer().changeMap(mapto, mapto.getPortal(0));
                        return;
                }
                showIntro(c, data);
                break;
            case "mPark_stageEff":
                c.getPlayer().dropMessage(-1, "必须消灭掉地图上的所有怪物，才能移动到下一关。");
                switch ((c.getPlayer().getMapId() % 1000) / 100) {
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                        c.announce(UIPacket.showMapEffect("monsterPark/stageEff/stage"));
                        c.announce(UIPacket.showMapEffect("monsterPark/stageEff/number/" + (((c.getPlayer().getMapId() % 1000) / 100) + 1)));
                        break;
                    case 4:
                        if (c.getPlayer().getMapId() / 1000000 == 952) {
                            c.announce(UIPacket.showMapEffect("monsterPark/stageEff/final"));
                        } else {
                            c.announce(UIPacket.showMapEffect("monsterPark/stageEff/stage"));
                            c.announce(UIPacket.showMapEffect("monsterPark/stageEff/number/5"));
                        }
                        break;
                    case 5:
                        c.announce(UIPacket.showMapEffect("monsterPark/stageEff/final"));
                        break;
                }
                break;
            case "aswan_stageEff": {
                c.getPlayer().dropMessage(-1, "必须消灭掉地图上的所有怪物，才能移动到下一关。");
                switch ((c.getPlayer().getMapId() % 1000) / 100) {
                    case 1:
                    case 2:
                        c.announce(UIPacket.showMapEffect("aswan/stageEff/stage"));
                        c.announce(UIPacket.showMapEffect("aswan/stageEff/number/" + ((c.getPlayer().getMapId() % 1000) / 100)));
                        break;
                    case 3:
                        c.announce(UIPacket.showMapEffect("aswan/stageEff/final"));
                        break;
                }
                break;
            }
            case "TD_MC_title": {
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroLock(false));
                c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                c.announce(UIPacket.showMapEffect("temaD/enter/mushCatle"));
                break;
            }
            case "TD_NC_title": {
                switch ((c.getPlayer().getMapId() / 100) % 10) {
                    case 0:
                        c.announce(UIPacket.showMapEffect("temaD/enter/teraForest"));
                        break;
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                        c.announce(UIPacket.showMapEffect("temaD/enter/neoCity" + ((c.getPlayer().getMapId() / 100) % 10)));
                        break;
                }
                break;
            }
            case "enter_masRoom": {
                if (c.getPlayer().getQuestStatus(23213) == 1 && c.getPlayer().getQuestStatus(23214) != 1 && c.getPlayer().getQuestStatus(23214) != 2) {
                    MapleQuest.getInstance(23213).forceComplete(c.getPlayer(), 0);
                    MapleQuest.getInstance(23214).forceStart(c.getPlayer(), 0, "1");
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(931050120);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                    break;
                }
                break;
            }
            case "enter_23214":
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9001038), new Point(816, -14));
                break;
            case "dublTuto21":
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300522), new Point(-578, 152));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300521), new Point(-358, 152));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300522), new Point(-138, 152));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300522), new Point(-82, 152));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300522), new Point(-302, 152));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300522), new Point(-522, 152));
                break;
            case "dublTuto23":
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300523), new Point(-283, 152));
                break;
            case "np_tuto_0_0_before":
                try {
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(MaplePacketCreator.environmentChange("newPirate/text0", 13));
                    c.announce(UIPacket.getDirectionInfo(1, 9500));
                    Thread.sleep(9500);
                } catch (InterruptedException var7_38) {
                    // empty catch block
                }
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroEnableUI(0));
                c.getPlayer().changeMap(552000010, 0);
                break;
            case "np_tuto_0_0":
                c.announce(UIPacket.inGameCurNodeEventEnd(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.getDirectionInfo(3, 1));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.getDirectionInfo(1, 2000));
                try {
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo("Effect/DirectionNewPirate.img/newPirate/balloonMsg2/0", 0, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                } catch (InterruptedException var7_39) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9270083, "np_tuto_0_1");
                break;
            case "map_913070000":
                try {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.getTopMsg("Mr.Limbert's General Store"));
                    c.announce(UIPacket.getDirectionInfo(1, 500));
                    Thread.sleep(500);
                    c.announce(UIPacket.getTopMsg("Month 3, Day 4"));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/0", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionFacialExpression(6, 10000));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/1", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/2", 3000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionFacialExpression(4, 8000));
                    c.announce(UIPacket.getDirectionInfo(1, 3000));
                    Thread.sleep(3000);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/3", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionFacialExpression(6, 2000));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    Thread.sleep(500);
                } catch (InterruptedException var7_40) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 9075005, "tuto001");
                break;
            case "map_913070001":
                c.announce(UIPacket.getTopMsg("Mr.Limbert's General Store"));
                c.announce(UIPacket.getTopMsg("Month 3, Day 4"));
                break;
            case "map_913070002":
                c.announce(UIPacket.getTopMsg("Mr.Limbert's General Store"));
                c.announce(UIPacket.getTopMsg("Month 3, Day 8"));
                break;
            case "map_913070020":
                c.announce(UIPacket.getTopMsg("Mr.Limbert's General Store"));
                c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9001051), new Point(185, 65));
                c.announce(MaplePacketCreator.getClock(300));
                Timer.MapTimer.getInstance().schedule(() -> {
                    if (c.getPlayer().getMapId() == 913070020) {
                        c.getPlayer().changeMap(913070003, 0);
                    }
                }, 300000);
                break;
            case "map_913070004":
                try {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.getTopMsg("Mr.Limbert's General Store"));
                    c.announce(UIPacket.getTopMsg("Month 3, Day 11"));
                    Thread.sleep(500);
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/5", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 500));
                    Thread.sleep(500);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/6", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/4", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/7", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/8", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getTopMsg("Someone suspicious is in the back yard..."));
                } catch (InterruptedException var7_41) {
                    // empty catch block
                }
                c.announce(UIPacket.IntroEnableUI(0));
                c.announce(UIPacket.IntroDisableUI(false));
                c.sendEnableActions();
                break;
            case "map_913070050":
                try {
                    MapleQuest.getInstance(20034).forceStart(c.getPlayer(), 1106000, null);
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.getTopMsg("General Store Yard"));
                    c.announce(MaplePacketCreator.getClock(600));
                    Timer.MapTimer.getInstance().schedule(() -> {
                        if (c.getPlayer().getMapId() >= 913070050 && c.getPlayer().getMapId() < 913070070) {
                            c.getPlayer().changeMap(913070004, 0);
                        }
                    }, 600000);
                    c.announce(UIPacket.getDirectionInfo("Effect/Direction7.img/effect/tuto/step0/4", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 2000));
                    Thread.sleep(2000);
                    c.announce(UIPacket.getDirectionFacialExpression(6, 10000));
                } catch (InterruptedException var7_42) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1106000, "tuto004");
                break;
            case "mihail_direc":
                try {
                    c.announce(UIPacket.IntroDisableUI(true));
                    c.announce(UIPacket.IntroLock(true));
                    showIntro(c, "Effect/Direction7.img/mikhail/1st_Job");
                    while (c.getPlayer().getLevel() < 10) {
                        c.getPlayer().levelUp();
                    }
                    c.getPlayer().changeJob(5100);
                    Thread.sleep(4000);
                    c.announce(UIPacket.IntroDisableUI(false));
                    c.announce(UIPacket.IntroLock(false));
                    c.getPlayer().changeMap(130000000, 0);
                    c.getPlayer().changeChannel(c.getChannel());
                } catch (InterruptedException var7_43) {
                }
                break;
            case "PTtutor000":
                try {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.playMovie("phantom_memory.avi", true));
                    Thread.sleep(85000);
                    c.announce(MaplePacketCreator.showEffect("phantom/mapname1"));
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo("Effect/OnUserEff.img/questEffect/phantom/tutorial", 2000, 0, -100, 1, 0));
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                    c.announce(UIPacket.getDirectionInfo(3, 1));
                    c.announce(UIPacket.getDirectionInfo(1, 500));
                    Thread.sleep(500);
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(1, 1000));
                    Thread.sleep(1000);
                } catch (InterruptedException var7_44) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1402100, "PTtutor000_0");
                break;
            case "PTtutor100":
                break;
            case "PTtutor200":
                break;
            case "PTtutor300": {
                c.announce(MaplePacketCreator.showEffect("phantom/mapname2"));
                String[] strings = new String[]{"UI/tutorial.img/phantom/0/0", "UI/tutorial.img/phantom/1/0", "UI/tutorial.img/phantom/2/0", "UI/tutorial.img/phantom/3/0", "UI/tutorial.img/phantom/4/0", "UI/tutorial.img/phantom/5/0"};
                c.announce(NPCPacket.sendMenu(strings));
                break;
            }
            case "PTtutor301":
                break;
            case "PTtutor400":
                break;
            case "PTtutor500":
                c.announce(UIPacket.IntroEnableUI(1));
                try {
                    c.announce(MaplePacketCreator.showEffect("phantom/mapname3"));
                    Thread.sleep(3000);
                } catch (InterruptedException var7_46) {
                    // empty catch block
                }
                NPCScriptManager.getInstance().dispose(c);
                c.removeClickedNPC();
                NPCScriptManager.getInstance().start(c, 1402100, "PTtutor500_0");
                break;
            case "PTjob1":
                if (c.getPlayer().getLevel() < 10) {
                    while (c.getPlayer().getLevel() < 10) {
                        c.getPlayer().levelUp();
                    }
                    c.getPlayer().changeJob(2400);
                    c.getPlayer().setExp(0);
                    break;
                }
                break;
            case "PTjob2M":
                c.getPlayer().setQuestAdd(MapleQuest.getInstance(25102), (byte) 1, "1");
                if (c.getPlayer().getMap().getMobsSize() < 1) {
                    c.getPlayer().getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9001045), new Point(171, 182));
                    break;
                }
                break;
            case "enter_edelstein":
            case "patrty6_1stIn":
            case "standbyAzwan":
            case "angelic_tuto0": {
                if (c.getPlayer().getJob() == 6001) {
                    while (c.getPlayer().getLevel() < 10) {
                        c.getPlayer().levelUp();
                    }
                    c.getPlayer().changeJob(6500);
                    c.getPlayer().gainItem(1142495, 1, "\u811a\u672c\u83b7\u5f97");
                    MapleMap map = c.getChannelServer().getMapFactory().getMap(400000000);
                    c.getPlayer().changeMap(map, map.getPortal(0));
                    break;
                }
                break;
            }
            case "PTjob3M2":
                if (c.getPlayer().getQuestStatus(25111) == 1) {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    Timer.EventTimer.getInstance().schedule(() -> c.announce(UIPacket.getDirectionInfo(3, 0)), 2500);
                    MapleQuest.getInstance(25111).forceComplete(c.getPlayer(), 0);
                    try {
                        Thread.sleep(3000);
                        break;
                    } catch (InterruptedException var7_48) {
                        // empty catch block
                    }
                    for (int i = 0; i <= 10000; i += 100) {
                        if (c.getPlayer().getJob() == 2410) {
                            c.announce(UIPacket.IntroEnableUI(0));
                            c.removeClickedNPC();
                            NPCScriptManager.getInstance().dispose(c);
                            c.sendEnableActions();
                            MapleQuest.getInstance(29969).forceComplete(c.getPlayer(), 0);
                            try {
                                Thread.sleep(2000);
                            } catch (InterruptedException var9_64) {
                                // empty catch block
                            }
                            c.getPlayer().changeJob(2411);
                            try {
                                Thread.sleep(2000);
                            } catch (InterruptedException var9_65) {
                                // empty catch block
                            }
                            c.announce(MaplePacketCreator.showEffect("phantom/suu"));
                            c.removeClickedNPC();
                            NPCScriptManager.getInstance().dispose(c);
                            c.sendEnableActions();
                            break;
                        }
                        try {
                            Thread.sleep(500);
                            continue;
                        } catch (InterruptedException var9_63) {
                            // empty catch block
                        }
                    }
                    break;
                }
                c.getPlayer().dropMessage(5, "Or move out and proof your strength!");
                break;
            case "PTjob4M":
                if (c.getPlayer().getQuestStatus(25120) == 1) {
                    MapleQuest.getInstance(25120).forceComplete(c.getPlayer(), 0);
                    break;
                }
                c.getPlayer().dropMessage(5, "Or move out and proof your strength!");
                break;
            case "PTjob4M_1":
                if (c.getPlayer().getJob() != 2411) {
                    c.getPlayer().dropMessage(5, "Or move out and proof your strength!");
                }
                c.getPlayer().getMap().resetFully();
                c.getPlayer().forceCompleteQuest(25122);
                if (!c.getPlayer().getMap().containsNPC(2159307)) {
                    c.getPlayer().getMap().spawnNpc(1403002, new Point(302, 182));
                }
                break;
            case "PTjob4M2":
                if (c.getPlayer().getQuestStatus(25122) == 2 && c.getPlayer().getJob() == 2411) {
                    c.announce(UIPacket.IntroEnableUI(1));
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    c.announce(UIPacket.getDirectionInfo(1, 30));
                    c.announce(UIPacket.inGameCurNodeEventEnd(true));
                    Timer.EventTimer.getInstance().schedule(() -> {
                        c.announce(UIPacket.getDirectionInfo(3, 0));
                        c.announce(MaplePacketCreator.showEffect("demonSlayer/text6"));
                    }, 2500);
                    ScheduledFuture<?> schedule = Timer.EventTimer.getInstance().schedule(() -> {
                        c.announce(UIPacket.getDirectionInfo(3, 0));
                        c.announce(MaplePacketCreator.showEffect("demonSlayer/text5"));
                    }, 4500);
                    Timer.EventTimer.getInstance().schedule(() -> {
                        c.announce(UIPacket.IntroEnableUI(0));
                        c.removeClickedNPC();
                        NPCScriptManager.getInstance().dispose(c);
                        c.sendEnableActions();
                    }, 6500);
                    Timer.EventTimer.getInstance().schedule(() -> c.getPlayer().dropMessage(-1, "Come inside me, Phantom!"), 8500);
                    Timer.EventTimer.getInstance().schedule(() -> {
                        for (double d2 = 0.0; d2 <= 20000.0; d2 += 100.0) {
                            if (c.getPlayer().getJob() == 2411 && c.getPlayer().getPosition().y == -30) {
                                c.getPlayer().changeJob(2412);
                                try {
                                    Thread.sleep(1000);
                                } catch (InterruptedException interruptedException) {
                                    // empty catch block
                                }
                                c.announce(MaplePacketCreator.showEffect("phantom/darkphantom"));
                                break;
                            }
                            try {
                                Thread.sleep(500);
                            } catch (InterruptedException interruptedException) {
                                break;
                            }
                        }
                    }, 9000);
                    break;
                }
                c.getPlayer().dropMessage(5, "Or move out, and proof your strength!");
                break;
            case "q53244_dun_in":
                c.announce(UIPacket.IntroEnableUI(0));
                try {
                    Thread.sleep(1500);
                } catch (InterruptedException var7_51) {
                    // empty catch block
                }
                c.getPlayer().getMap().resetFully();
                c.getPlayer().dropMessage(-1, "Father, There they are. All located in the planets!");
                if (!c.getPlayer().getMap().containsNPC(9270084)) {
                    c.getPlayer().getMap().spawnNpc(9270084, new Point(-103, 55));
                }
                if (!c.getPlayer().getMap().containsNPC(9270090)) {
                    c.getPlayer().getMap().spawnNpc(9270090, new Point(65, 55));
                }
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo("Effect/DirectionNewPirate.img/newPirate/balloonMsg2/11", 2000, 0, 1, -100, 1));
                for (int i = 0; i < 10; ++i) {
                    c.announce(UIPacket.getDirectionInfo(3, 5));
                    try {
                        Thread.sleep(700);
                    } catch (InterruptedException var8_59) {
                        // empty catch block
                    }
                }
                c.announce(UIPacket.getDirectionInfo(3, 2));
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.getPlayer().dropMessage(-1, "Heh heh heh, nguoi da cham soc no tot that day!");
                    try {
                        Thread.sleep(200);
                    } catch (InterruptedException interruptedException) {
                        // empty catch block
                    }
                    c.announce(UIPacket.getDirectionInfo(3, 2));
                    try {
                        Thread.sleep(200);
                    } catch (InterruptedException interruptedException) {
                        // empty catch block
                    }
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    NPCScriptManager.getInstance().start(c, 9270090, "q53244_dun_in");
                }, 1000);
                break;
            case "q53251_enter":
                c.announce(UIPacket.IntroEnableUI(1));
                try {
                    Thread.sleep(1500);
                } catch (InterruptedException var7_53) {
                    // empty catch block
                }
                c.getPlayer().getMap().resetFully();
                if (!c.getPlayer().getMap().containsNPC(9270092)) {
                    c.getPlayer().getMap().spawnNpc(9270092, new Point(352, 55));
                }
                c.announce(UIPacket.getDirectionInfo(3, 2));
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException var7_54) {
                    // empty catch block
                }
                Timer.EventTimer.getInstance().schedule(() -> NPCScriptManager.getInstance().start(c, 9270092, "q53251_enter"), 1000);
                break;
            case "cannon_tuto_01": {
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionStatus(true));
                c.getPlayer().changeSingleSkillLevel(SkillFactory.getSkill(110), (byte) 1, (byte) 1); //海盗祝福 - [种族特性技能]强化火炮手特有的坚韧，永久提高各种属性。
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.getDirectionInfo(4, 1096000));
                NPCScriptManager.getInstance().dispose(c);
                NPCScriptManager.getInstance().start(c, 1096000);
                break;
            }
            case "TD_MC_Openning": {
                showIntro(c, "Effect/Direction2.img/open");
                break;
            }
            case "TD_MC_gasi": {
                showIntro(c, "Effect/Direction2.img/gasi");
                break;
            }
            case "check_count": {
                if (c.getPlayer().getMapId() == 950101010 && (!c.getPlayer().haveItem(4001433, 20) || c.getPlayer().getLevel() < 50)) { //ravana Map
                    MapleMap mapp = c.getChannelServer().getMapFactory().getMap(950101100); //exit Map
                    c.getPlayer().changeMap(mapp, mapp.getPortal(0));
                }
                break;
            }
            case "Massacre_first": { //sends a whole bunch of shit.
                if (c.getPlayer().getPyramidSubway() == null) {
                    c.getPlayer().setPyramidSubway(new Event_PyramidSubway(c.getPlayer()));
                }
                break;
            }
            case "magnus_enter_HP":
                if (c.getPlayer().getMapId() >= 401060100 && c.getPlayer().getMapId() < 401060100) {
                    MapleMonster monster = MapleLifeFactory.getMonster(8880000);
                    if (c.getPlayer().getEventInstance() != null) {
                        int level = 0;
                        int totalLevel = 0;
                        for (MapleCharacter character : c.getPlayer().getEventInstance().getPlayers()) {
                            level += character.getLevel();
                            ++totalLevel;
                        }
                        if (totalLevel <= 0) {
                            return;
                        }
                        monster.changeLevel(level /= totalLevel);
                        c.getPlayer().getEventInstance().registerMonster(monster);
                        if (c.getPlayer().getEventInstance().getProperty("HP") == null) {
                            c.getPlayer().getEventInstance().setProperty("HP", "" + level + "000");
                        }
                        monster.setHp(Long.parseLong(c.getPlayer().getEventInstance().getProperty("HP")));
                    }
                    c.getPlayer().getMap().spawnMonsterWithEffectBelow(monster, new Point(c.getPlayer().getMap().getPortal(0).getPosition()), 12);
                    monster.switchController(c.getPlayer(), false);
                    c.announce(MobPacket.mobEscortReturnBefore(monster, c.getPlayer().getMap()));
                    break;
                }
                break;
            case "azwan_stageEff":
                switch (c.getPlayer().getMapId() % 1000 / 100) {
                    case 1:
                    case 2:
                    case 3: {
                        c.announce(MaplePacketCreator.showEffect("aswan/stageEff/stage"));
                        c.announce(MaplePacketCreator.showEffect("aswan/stageEff/number/" + c.getPlayer().getMapId() % 1000 / 100));
                        break;
                    }
                }
                synchronized (MapScriptMethods.class) {
                    for (final MapleMonster monster : c.getPlayer().getMap().getAllMonster()) {
                        if (monster.getEventInstance() == null) {
                            c.getPlayer().getEventInstance().registerMonster(monster);
                        }
                    }
                }
                break;
            case "Massacre_result": { //clear, give exp, etc.
                c.announce(MaplePacketCreator.showEffect("killing/fail"));
                break;
            }
            case "hayatoJobChange":
                if (c.getPlayer().getJob() != MapleJob.恶魔猎手4转.getId()) {
                    while (c.getPlayer().getLevel() < 10) {
                        c.getPlayer().levelUp();
                    }
                    break;
                }
                if (c.getPlayer().getQuestStatus(28862) != 2) {
                    while (c.getPlayer().getLevel() < 10) {
                        c.getPlayer().levelUp();
                    }
                    unEquip(c, 1003567, true);
                    unEquip(c, 1052473, true);
                    unEquip(c, 1072678, true);
                    unEquip(c, 1082442, true);
                    unEquip(c, 1542044, true);
                    c.getPlayer().forceCompleteQuest(28862);
                }
                break;
            case "Sky_StageEnter":
                switch (c.getPlayer().getMapId()) {
                    case 240080500: {
                        c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.飞翔);
                    }
                }
                break;

            case "prisonBreak_1stageEnter":
            case "shammos_Start":
            case "moonrabbit_takeawayitem":
            case "TCMobrevive":
            case "cygnus_ExpeditionEnter":
            case "knights_Summon":
            case "Resi_tutor10":
            case "Resi_tutor60":
            case "Resi_tutor50_1":
            case "sealGarden":
            case "in_secretroom":
            case "TD_MC_gasi2":
            case "TD_MC_keycheck":
            case "pepeking_effect":
            case "userInBattleSquare":
            case "summonSchiller":
            case "VisitorleaveDirectionMode":
            case "visitorPT_Enter":
            case "VisitorCubePhase00_Enter":
            case "visitor_ReviveMap":
            case "PRaid_D_Enter":
            case "PRaid_B_Enter":
            case "PRaid_WinEnter": //handled by event
            case "PRaid_FailEnter": //also
            case "PRaid_Revive": //likely to subtract points or remove a life, but idc rly
            case "metro_firstSetting":
            case "blackSDI":
            case "summonIceWall":
            case "onSDI":
            case "enterBlackfrog":
            case "Sky_Quest": //forest that disappeared 240030102
            case "dollCave00":
            case "dollCave01":
            case "dollCave02":
            case "shammos_Base":
            case "shammos_Result":
            case "Sky_BossEnter":
            case "Sky_GateMapEnter":
            case "balog_dateSet":
            case "balog_buff":
            case "outCase":
            case "evanTogether":
            case "merStandAlone":
            case "EntereurelTW":
            case "aranTutorAlone":
            case "evanAlone": { //no idea
                c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                break;
            }
            case "merTutorDrecotion00": {
                c.announce(UIPacket.playMovie("Mercedes.avi", true));
                Map<Integer, SkillEntry> sDate = new HashMap<>();
                sDate.put(20021181, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(20021166, new SkillEntry((byte) 1, (byte) 1, -1));
                c.getPlayer().changeSkillsLevel(sDate);
                break;
            }
            case "merTutorDrecotion10": {
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/6", 2000, 0, -100, 1));
                c.announce(UIPacket.getDirectionInfo(1, 2000));
                c.getPlayer().setDirection(0);
                break;
            }
            case "merTutorDrecotion20": {
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/mercedesInIce/merBalloon/9", 2000, 0, -100, 1));
                c.announce(UIPacket.getDirectionInfo(1, 2000));
                c.getPlayer().setDirection(0);
                break;
            }
            case "ds_tuto_ani": {
                c.announce(UIPacket.playMovie("DemonSlayer1.avi", true));
                break;
            }
            case "explorationPoint": {
                explorationPoint(c);
                break;
            }
            case "go10000":
            case "go1020000":
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroLock(false));
                c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
            case "go20000":
            case "go30000":
            case "go40000":
            case "go50000":
            case "go1000000":
            case "go2000000":
            case "go1010000":
            case "go1010100":
            case "go1010200":
            case "go1010300":
            case "go1010400": {
                c.announce(UIPacket.MapNameDisplay(c.getPlayer().getMapId()));
                break;
            }
            case "TD_LC_title":
                c.announce(MaplePacketCreator.showEffect("temaD/enter/lionCastle"));
                break;
            case "ds_tuto_ill0": {
                c.announce(UIPacket.getDirectionInfo(1, 6300));
                showIntro(c, "Effect/Direction6.img/DemonTutorial/SceneLogo");
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.IntroDisableUI(false));
                    c.announce(UIPacket.IntroLock(false));
                    c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                    MapleMap mapto = c.getChannelServer().getMapFactory().getMap(927000000);
                    c.getPlayer().changeMap(mapto, mapto.getPortal(0));
                }, 6300); //wtf
                break;
            }
            case "ds_tuto_home_before": {
                c.announce(UIPacket.getDirectionInfo(3, 1));
                c.announce(UIPacket.getDirectionInfo(1, 30));
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.getDirectionInfo(1, 90));

                c.announce(MaplePacketCreator.showEffect("demonSlayer/text11"));
                c.announce(UIPacket.getDirectionInfo(1, 4000));
                Timer.EventTimer.getInstance().schedule(() -> showIntro(c, "Effect/Direction6.img/DemonTutorial/Scene2"), 1000);
                break;
            }
            case "ds_tuto_1_0": {
                c.announce(UIPacket.getDirectionInfo(3, 1));
                c.announce(UIPacket.getDirectionInfo(1, 30));
                c.announce(UIPacket.getDirectionStatus(true));

                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(4, 2159310));
                    NPCScriptManager.getInstance().start(c, 2159310);
                }, 1000);
                break;
            }
            case "ds_tuto_4_0": {
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.getDirectionInfo(4, 2159344));
                NPCScriptManager.getInstance().start(c, 2159344);
                break;
            }
            case "ds_tuto_5_0": {
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(UIPacket.getDirectionInfo(4, 2159314));
                NPCScriptManager.getInstance().dispose(c);
                NPCScriptManager.getInstance().start(c, 2159314);
                break;
            }
            case "ds_tuto_3_0": {
                c.announce(UIPacket.getDirectionInfo(3, 1));
                c.announce(UIPacket.getDirectionInfo(1, 30));
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(MaplePacketCreator.showEffect("demonSlayer/text12"));

                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(4, 2159311));
                    NPCScriptManager.getInstance().dispose(c);
                    NPCScriptManager.getInstance().start(c, 2159311);
                }, 1000);
                break;
            }
            case "ds_tuto_3_1": {
                c.announce(UIPacket.IntroDisableUI(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionStatus(true));
                if (!c.getPlayer().getMap().containsNPC(2159340)) {
                    c.getPlayer().getMap().spawnNpc(2159340, new Point(175, 0));
                    c.getPlayer().getMap().spawnNpc(2159341, new Point(300, 0));
                    c.getPlayer().getMap().spawnNpc(2159342, new Point(600, 0));
                }
                c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/tuto/balloonMsg2/0", 2000, 0, -100, 1));
                c.announce(UIPacket.getDirectionInfo("Effect/Direction5.img/effect/tuto/balloonMsg1/3", 2000, 0, -100, 1));
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(UIPacket.getDirectionInfo(4, 2159340));
                    NPCScriptManager.getInstance().dispose(c);
                    NPCScriptManager.getInstance().start(c, 2159340);
                }, 1000);
                break;
            }
            case "ds_tuto_2_before": {
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.getDirectionInfo(3, 1));
                c.announce(UIPacket.getDirectionInfo(1, 30));
                c.announce(UIPacket.getDirectionStatus(true));
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(MaplePacketCreator.showEffect("demonSlayer/text13"));
                    c.announce(UIPacket.getDirectionInfo(1, 500));
                }, 1000);
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(MaplePacketCreator.showEffect("demonSlayer/text14"));
                    c.announce(UIPacket.getDirectionInfo(1, 4000));
                }, 1500);
                Timer.EventTimer.getInstance().schedule(() -> {
                    MapleMap mapto = c.getChannelServer().getMapFactory().getMap(927000020);
                    c.getPlayer().changeMap(mapto, mapto.getPortal(0));
                    c.announce(UIPacket.IntroEnableUI(0));
                    MapleQuest.getInstance(23204).forceStart(c.getPlayer(), 0, null);
                    MapleQuest.getInstance(23205).forceComplete(c.getPlayer(), 0);
                    Map<Integer, SkillEntry> sDate = new HashMap<>();
                    sDate.put(30011170, new SkillEntry((byte) 1, (byte) 1, -1));
                    sDate.put(30011169, new SkillEntry((byte) 1, (byte) 1, -1));
                    sDate.put(30011168, new SkillEntry((byte) 1, (byte) 1, -1));
                    sDate.put(30011167, new SkillEntry((byte) 1, (byte) 1, -1));
                    sDate.put(30010166, new SkillEntry((byte) 1, (byte) 1, -1));
                    c.getPlayer().changeSkillsLevel(sDate);
                }, 5500);
                break;
            }
            case "ds_tuto_1_before": {
                c.announce(UIPacket.getDirectionInfo(3, 1));
                c.announce(UIPacket.getDirectionInfo(1, 30));
                c.announce(UIPacket.getDirectionStatus(true));
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(UIPacket.getDirectionInfo(3, 0));
                    c.announce(MaplePacketCreator.showEffect("demonSlayer/text8"));
                    c.announce(UIPacket.getDirectionInfo(1, 500));
                }, 1000);
                Timer.EventTimer.getInstance().schedule(() -> {
                    c.announce(MaplePacketCreator.showEffect("demonSlayer/text9"));
                    c.announce(UIPacket.getDirectionInfo(1, 3000));
                }, 1500);
                Timer.EventTimer.getInstance().schedule(() -> {
                    MapleMap mapto = c.getChannelServer().getMapFactory().getMap(927000010);
                    c.getPlayer().changeMap(mapto, mapto.getPortal(0));
                }, 4500);
                break;
            }
            case "ds_tuto_0_0": {
                c.announce(UIPacket.getDirectionStatus(true));
                c.announce(UIPacket.IntroEnableUI(1));
                c.announce(UIPacket.IntroDisableUI(true));
                Map<Integer, SkillEntry> sDate = new HashMap<>();
                sDate.put(恶魔猎手.恶魔之翼, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(恶魔猎手.恶魔跳跃, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(恶魔猎手.死亡诅咒, new SkillEntry((byte) 1, (byte) 1, -1));
                sDate.put(恶魔猎手.恶魔之血, new SkillEntry((byte) 1, (byte) 1, -1));
                c.getPlayer().changeSkillsLevel(sDate);
                c.announce(UIPacket.getDirectionInfo(3, 0));
                c.announce(MaplePacketCreator.showEffect("demonSlayer/back"));
                c.announce(MaplePacketCreator.showEffect("demonSlayer/text0"));
                c.announce(UIPacket.getDirectionInfo(1, 500));
                c.getPlayer().setDirection(0);
                if (!c.getPlayer().getMap().containsNPC(2159307)) {
                    c.getPlayer().getMap().spawnNpc(2159307, new Point(1305, 50));
                }
                break;
            }
            case "ds_tuto_2_prep": {
                if (!c.getPlayer().getMap().containsNPC(2159309)) {
                    c.getPlayer().getMap().spawnNpc(2159309, new Point(550, 50));
                }
                break;
            }
            case "goArcher": {
                showIntro(c, "Effect/Direction3.img/archer/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "goPirate": {
                showIntro(c, "Effect/Direction3.img/pirate/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "goRogue": {
                showIntro(c, "Effect/Direction3.img/rogue/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "goMagician": {
                showIntro(c, "Effect/Direction3.img/magician/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "goSwordman": {
                showIntro(c, "Effect/Direction3.img/swordman/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "goLith": {
                showIntro(c, "Effect/Direction3.img/goLith/Scene" + (c.getPlayer().getGender() == 0 ? "0" : "1"));
                break;
            }
            case "aranDirection": {
                switch (c.getPlayer().getMapId()) {
                    case 914090010:
                        data = "Effect/Direction1.img/aranTutorial/Scene0";
                        break;
                    case 914090011:
                        data = "Effect/Direction1.img/aranTutorial/Scene1" + (c.getPlayer().getGender() == 0 ? "0" : "1");
                        break;
                    case 914090012:
                        data = "Effect/Direction1.img/aranTutorial/Scene2" + (c.getPlayer().getGender() == 0 ? "0" : "1");
                        break;
                    case 914090013:
                        data = "Effect/Direction1.img/aranTutorial/Scene3";
                        break;
                    case 914090100:
                        data = "Effect/Direction1.img/aranTutorial/HandedPoleArm" + (c.getPlayer().getGender() == 0 ? "0" : "1");
                        break;
                    case 914090200:
                        data = "Effect/Direction1.img/aranTutorial/Maha";
                        break;
                }
                showIntro(c, data);
                break;
            }
            case "iceCave": {
                Map<Integer, SkillEntry> sDate = new HashMap<>();
                sDate.put(战神.教程技能1, new SkillEntry((byte) -1, (byte) 0, -1));
                sDate.put(战神.教程技能2, new SkillEntry((byte) -1, (byte) 0, -1));
                sDate.put(战神.教程技能3, new SkillEntry((byte) -1, (byte) 0, -1));
                sDate.put(战神.教程技能4, new SkillEntry((byte) -1, (byte) 0, -1));
                sDate.put(战神.教程技能5, new SkillEntry((byte) -1, (byte) 0, -1));
                c.getPlayer().changeSkillsLevel(sDate);
                c.announce(EffectPacket.ShowWZEffect("Effect/Direction1.img/aranTutorial/ClickLirin"));
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroLock(false));
                c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
                break;
            }
            case "rienArrow": {
                if (c.getPlayer().getInfoQuest(21019).equals("miss=o;helper=clear")) {
                    c.getPlayer().updateInfoQuest(21019, "miss=o;arr=o;helper=clear");
                    c.announce(EffectPacket.AranTutInstructionalBalloon("Effect/OnUserEff.img/guideEffect/aranTutorial/tutorialArrow3"));
                }
                break;
            }
            case "rien": {
                if (c.getPlayer().getQuestStatus(21101) == 2 && c.getPlayer().getInfoQuest(21019).equals("miss=o;arr=o;helper=clear")) {
                    c.getPlayer().updateInfoQuest(21019, "miss=o;arr=o;ck=1;helper=clear");
                }
                c.announce(UIPacket.IntroDisableUI(false));
                c.announce(UIPacket.IntroLock(false));
                break;
            }
            default: {
//                log.info("地图触发: 未找到 " + scriptName + ", 类型: onUserEnter - 地图ID " + c.getPlayer().getMapId());
                NPCScriptManager.getInstance().onUserEnter(c, scriptName);
                break;
            }
        }
        if (bl2) {
            c.getPlayer().updateMapScript(MapScriptType.onUserEnter, scriptName);
        } else {
            c.getPlayer().updateMapScript(MapScriptType.UNK, scriptName);
        }
    }

    private static void unEquip(MapleClient c, int itemid, boolean fromDrop) {
        MapleInventory equipeds = c.getPlayer().getInventory(MapleInventoryType.EQUIPPED);
        MapleInventory equips = c.getPlayer().getInventory(MapleInventoryType.EQUIP);
        Equip item = null;
        for (Item i : equipeds.newList()) {
            if (i.getItemId() != itemid) continue;
            item = (Equip) i;
        }
        if (item == null) {
            return;
        }
        MapleInventoryManipulator.addItemAndEquip(c, item.getPosition(), equips.getNextFreeSlot());
        if (fromDrop) {
            MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, item.getPosition(), (short) 1, fromDrop);
        }
    }

    public static void explorationPoint(MapleClient c) {
        if (c.getPlayer().getMapId() == 104000000) {
            c.announce(UIPacket.IntroDisableUI(false));
            c.announce(UIPacket.IntroLock(false));
            c.announce(MaplePacketCreator.updatePlayerStats(c.getPlayer()));
            c.announce(UIPacket.MapNameDisplay(c.getPlayer().getMapId()));
        }
        //c.getPlayer().dropMessage(-11, "当前地图信息: ID " + c.getPlayer().getMapId() + " 名字 " + c.getPlayer().getMap().getMapName());
        MedalQuest m = null;
        for (MedalQuest mq : MedalQuest.values()) {
            for (int i : mq.maps) {
                if (c.getPlayer().getMapId() == i) {
                    m = mq;
                    break;
                }
            }
        }
        if (m != null && c.getPlayer().getLevel() >= m.level && c.getPlayer().getQuestStatus(m.questid) != 2) {
            if (c.getPlayer().getQuestStatus(m.lquestid) != 1) {
                MapleQuest.getInstance(m.lquestid).forceStart(c.getPlayer(), 0, "0");
            }
            if (c.getPlayer().getQuestStatus(m.questid) != 1) {
                MapleQuest.getInstance(m.questid).forceStart(c.getPlayer(), 0, null);
                StringBuilder sb = new StringBuilder("enter=");
                for (int map : m.maps) {
                    sb.append("0");
                }
                c.getPlayer().updateInfoQuest(m.questid - 2005, sb.toString());
                MapleQuest.getInstance(m.questid - 1995).forceStart(c.getPlayer(), 0, "0");
            }
            String quest = c.getPlayer().getInfoQuest(m.questid - 2005);
            if (quest.length() != m.maps.length + 6) { //enter= is 6
                StringBuilder sb = new StringBuilder("enter=");
                for (int map : m.maps) {
                    sb.append("0");
                }
                quest = sb.toString();
                c.getPlayer().updateInfoQuest(m.questid - 2005, quest);
            }
            MapleQuestStatus stat = c.getPlayer().getQuestNAdd(MapleQuest.getInstance(m.questid - 1995));
            if (stat.getCustomData() == null) { //just a check.
                stat.setCustomData("0");
            }
            int number = Integer.parseInt(stat.getCustomData());
            StringBuilder sb = new StringBuilder("enter=");
            boolean changedd = false;
            for (int i = 0; i < m.maps.length; i++) {
                boolean changed = false;
                if (c.getPlayer().getMapId() == m.maps[i]) {
                    if (quest.substring(i + 6, i + 7).equals("0")) {
                        sb.append("1");
                        changed = true;
                        changedd = true;
                    }
                }
                if (!changed) {
                    sb.append(quest, i + 6, i + 7);
                }
            }
            if (changedd) {
                number++;
                c.getPlayer().updateInfoQuest(m.questid - 2005, sb.toString());
                MapleQuest.getInstance(m.questid - 1995).forceStart(c.getPlayer(), 0, String.valueOf(number));
                c.getPlayer().dropMessage(-1, "探险了 " + number + "/" + m.maps.length + " 个地区");
                c.getPlayer().dropMessage(-1, "正在挑战称号 - " + String.valueOf(m) + "");
                c.announce(MaplePacketCreator.showQuestMsg("正在挑战称号 - " + String.valueOf(m) + "。" + number + "/" + m.maps.length + " 完成"));
            }
        }
    }

    private static void reloadWitchTower(MapleClient c) {
        MapleMap map = c.getPlayer().getMap();
        map.killAllMonsters(false);
        int level = c.getPlayer().getLevel();
        int mob;
        if (level <= 10) {
            mob = 9300367; //魔女的玩具熊
        } else if (level <= 20) {
            mob = 9300368; //魔女的玩具熊
        } else if (level <= 30) {
            mob = 9300369; //魔女的玩具熊
        } else if (level <= 40) {
            mob = 9300370; //魔女的玩具熊
        } else if (level <= 50) {
            mob = 9300371; //魔女的玩具熊
        } else if (level <= 60) {
            mob = 9300372; //魔女的玩具熊
        } else if (level <= 70) {
            mob = 9300373; //魔女的玩具熊
        } else if (level <= 80) {
            mob = 9300374; //魔女的玩具熊
        } else if (level <= 90) {
            mob = 9300375; //魔女的玩具熊
        } else if (level <= 100) {
            mob = 9300376; //魔女的玩具熊
        } else {
            mob = 9300377; //魔女的玩具熊
        }
        MapleMonster theMob = MapleLifeFactory.getMonster(mob);
        OverrideMonsterStats oms = new OverrideMonsterStats();
        oms.setOMp(theMob.getMobMaxMp());
        oms.setOExp(theMob.getMobExp());
        oms.setOHp((long) Math.ceil(theMob.getMobMaxHp() * (level / 5.0))); //10k to 4m
        theMob.setOverrideStats(oms);
        map.spawnMonsterOnGroundBelow(theMob, witchTowerPos);
    }

    private static void showIntro(MapleClient c, String data) {
        c.announce(UIPacket.IntroDisableUI(true));
        c.announce(UIPacket.IntroLock(true));
        c.announce(EffectPacket.ShowWZEffect(data));
    }

    public void reloadWitchTower() {
        reloadWitchTower(getClient());
    }

    public void startMapEffect(MapleClient c, String data, int itemId) {
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        if (!ii.itemExists(itemId)) {
            getPlayer().dropMessage(5, "地图效果触发 道具: " + itemId + " 不存在.");
            return;
        } else if (!ii.isFloatCashItem(itemId)) {
            getPlayer().dropMessage(5, "地图效果触发 道具: " + itemId + " 不具有漂浮公告的效果.");
            return;
        }
        getPlayer().getMap().startMapEffect(data, itemId);
    }

    public void sendMapNameDisplay(boolean enabled) {
        if (enabled) {
            getClient().announce(UIPacket.IntroDisableUI(false));
            getClient().announce(UIPacket.IntroLock(false));
        }
        getClient().announce(UIPacket.MapNameDisplay(getPlayer().getMapId()));
    }

    public void handlePinkBeanStart() {
        MapleMap map = getPlayer().getMap();
        map.resetFully();
        if (!map.containsNPC(2141000)) {
            map.spawnNpc(2141000, new Point(-190, -42));
        }
    }

    public enum MapScriptType {
        directionInfo,
        onFirstUserEnter,
        onUserEnter,
        UNK
    }
}
